DEVFYI - Developer Resource - FYI

How to check two arrays to see if contents have the same types and contain the same elements?

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

156. How to check two arrays to see if contents have the same types and contain the same elements?

One of options is to use the equals() method of Arrays class.
Arrays.equals(a, b);
If the array types are different, a compile-time error will happen.

(Continued on next question...)

Other Interview Questions