COMP 202 Study Guide - Final Guide: Static Variable, Parsing, Cartesian Coordinate System
hwpark22 and 40159 others unlocked
100
COMP 202 Full Course Notes
Verified Note
100 documents
Document Summary
Once a string has been created it cannot be changed. The elements of an array can be updated. What is stored in an array is the reference to where the array has been saved. Variables of array type and string-type both store the address in memory at which the elements of the object begin. Any reference type variable can have a null value null indicated the absence of an address. We can think of the variable with value null as a box with no arrow/ pointing nowhere. If we try to access information through a variable with value null, the code will throw a nullpointerexception. Default values: in java, local variables (those defined in within the body of a method, i. e. all the variables we have seen up to now) are not given an initial default value! array elements. This creates an array of length 3, containing integer arrays. Each element is an array of length 2.