java array methods

Java Arrays class

Java Arrays class: Here comes a confusion for a new Java learner with array, arrays and Arrays. He uses all interchangeably, meaning the same. He uses anyone just to refer arrays of Java. He thinks array and arrays are singular and plural. Of course, he is right. Problem comes once…

Sorting array elements sort() Comparator

The earlier sort() example sorts implicitly in natural ascending order. The order can be customized with the overloaded sort() method that takes a Comparator object as parameter. Two methods exist for sorting array elements with Arrays class. Following are the method signatures. static void sort(int array1[]): Sorts all the elements…