CPS 109 Lecture Notes - Lecture 2: Primitive Data Type, Boolean Expression, Leap Year

63 views16 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents