Java OCA OCP Practice Question 587

Question

Given arrays a1 and a2, which call returns true if a1 and a2 have the same length, and a1[i].equals(a2[i]) for every legal index i?

  • A. java.util.Arrays.equals(a1, a2);
  • B. java.util.Arrays.compare(a1, a2);
  • C. java.util.List.compare(a1, a2);
  • D. java.util.List.compare(a1, a2);


A.

Note

The Arrays class has a static equals() method that compares arrays member by member.




PreviousNext

Related