What is the differnece between the below two declarations. As results of both the statements are the same.Apart from that are there any other differences.
Certainly,there are differences. Do you know the differences from heap and stack? Array is an Object. When you declared an Object,the computer will create a space in the heap of memory and create a quote in the stack of memory. When you new an Object,the computer so do.
In my opinion, int[] aray1 = {1,2,3,4,5,5}; The statement will create one space and one quote.
int[] aray2 =new int[]{1,2,3,4}; The statement will create two space and one quote.