I am not able to make the difference between ArrayList and Array of objects in java. I am just a beginner. Also I am not able to understand that why Array is sorted by Arrays.sort and ArrayList is sorted by Collections.sort if both are array only.
1 Answer
The short answer is arrays have a set size you define where as an arraylist has infinite size. You'll learn a lot about them from the api
https://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Array.html
https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html
ArrayListhas an array in its implementation, but as far as Java's concerned that's the only overlap.Collectionsis a class that can't be instantiated, so, neither.Collectionis an interface.