Comparing Arrays The java.util.Arrays class provides a rich set of static methods for comparing arrays of primitive data types and…