int array initialization
问题 I have here a simple question related to Java. Let's say you have an int array as instance variable: int[] in = new int[5]; So, now by default it contains 5 zeros. But what if you have the same array as local variable. Does it get initialized to zeros? That is not a homework, I am learning Java language. Best regards 回答1: First thing to understand is that, local varibles are stored on stack which are not initialized explicitly with their default values. While instance variables are stored on