I have a question about where in memory arrays are stored when arrays are initialized.
I understand that local variables and method parameters are stored in stack; objects are stored in heap.
What I am wondering is if an array is initialized, is there a difference where they are stored in below cases? Assume they are in the main method.
int[] a = {1,2,3,4,5};
int[] b = new int[a.length];
Thank you for your answer :)