The following contrived example I just made to help me understand the inner workings of java.
public class Main { public static void main(String[] args) { int[] a; a = new int[12]; System.out.println(a); } }
This gives out trash. Since a is passed by reference, I assume that println gets the memory address of a and threatens it as a string. Am I right here? Can you clarify what exactly is happening? Thank you (note: I'm not interested in how to print an array. I know that.)
java arrays
noname
source share