1

In the code below, why do line 3,4 print different things ?

int[] a = {1,2,3};
List<Integer> b = Arrays.asList(1,2,3);
System.out.println(Arrays.asList(a)); // prints the address
System.out.println(b); // prints the content 
Achyuta Aich
  • 569
  • 1
  • 5
  • 13

0 Answers0