CPS 109 Lecture Notes - Lecture 2: Primitive Data Type, Boolean Expression, Leap Year
Document Summary
Lecture 2 & 3 & 4: decisions & loops. Values are unique to an instance of a class (or to each object) Not accessible from the rest of the class matter how many times the class is instantiated. If keyword final is used indicates it never changes. Minimum value of -128 and max value of 127 (inclusive) useful for saving memory in large arrays, and can replace int. Min value of -32,768 and max value of 32, 767 (inclusive) can be used to save memory in large arrays, and can replace int. Min value of -2^31 & max value of 2^31-1. Min value of -2^63 and max value of 2^63-1 used when a range of values larger than int is needed. 32-bit, floating point saves memory vs using double should not be used for precise values like currency, which use bigdecimal class instead.