In java you cannot specify the size of the array in your declaration
int[5] scores; //bad
I am told that this is due to the fact that the JVM does not allocate space in memory until the object is initialized. If you have an instance array variable (automatically initialized to null by default), does this variable indicate a place on the heap denoting zero?
, JVM . (, C ++), NULL . , , "" - , , MS-DOS . , - , . , , , .
JVM (.. ), null "" (, ), " t .
. , JVM , , . JVM NullPointerException, " " ".
, , " " . , -. .
, - Java -
Java null - , ( ). , . . 4 32- 8 64- . , , , .. String, Java 16 (2 ) , , , .
Java null - , ( ). , . . 4 32- 8 64- . , , , .
. String, Java 16 (2 ) , , , .
(, , )
... null (0x00) .
, "int [5] score;//bad" . , , ReferenceName = new () .
int [] scores = new int [5]; JLabel label = new JLabel();
() - int [] JLabel, ( ), ( , ) int [5], 5 ints JLabel(), , JLabel.