Why toString() method works differently between Array and ArrayList object in Java
String[] array = {"a","c","b"}; ArrayList<String> list = new ArrayList<String>(); list.add("a"); list.add("b"); list.add("c"); System.out.println(array); System.out.println(list); For list [a, b, c] is output while for array some address is output. When we want to output the array values, we can use Arrays.toString(array); which works just like list . I just wonder why we can't call toString() directly on array to get the values. Isn't it more intuitive and convenient to do so? What results in the different treatments on Array and ArrayList ? The main difference between an array and an