COMPSCI 61B Lecture Notes - Lecture 3: Linked Data, Uninitialized Variable, Instance Variable
Document Summary
Information is stored in memory as a sequence of ones and zeros. Letter h -> 01001000 (same as 72, but context is di erent (java type)) Each java type has a di erent way to interpret the bits: 8 primitive types in java: byte, short, int, long, oat, double, boolean, char. When you declare a variable of a certain type: Your computer sets aside exactly enough bits to hold a thing of that type int sets aside a box of 32 bits double sets aside a box of 64 bits. Java creates an internal table that maps each variable name to a location. Java does not write anything into the reserved boxes. For safety, java doesn"t allow access to an uninitialized variable. Instead of writing memory box contents in binary, we"ll write out the value from now on (also consistent with the java visualizer used in this class)