












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Emails in office hours, feel free to set up meeting via email JavaScript vs Java?
An identifier is the name of a variable (or object, class, method, etc.) int sum type identifier
Many other languages allow conversion between integer and boolean True = 1 and false = 0 Java does not allow this
int - Whole numbers in the approximate range: -2.14 billion to 2.14 billions ( 9 ) long - Whole numbers in the approximate range: -9.22 quintillion to 9.22 quintillion ( 18 ) Using int is standard (unless you really need more space, for example scientific computing)
float is now pretty much obsolete. double takes twice as much space in the computer and is 1) more accurate and 2) more precise Bottom line: use double (unless for a joke)
Both stored in scientific notation double x = 2858291; Computer's perspective: x = 2.858291e or x = 2.858291 * 10 6
Field of study for (reducing) computer error See: SubtractionError.java Can happen frequently when solving system of linear equations
If you are counting something (money), use int If you are dealing with abstract concepts (physics), use double int doesn't make “rounding” mistakes Non-primitive types exist for both int and double for more expression/precision
int x; double y; x+y int x; int y; x/y Converted to double Not converted (still int)
See: SimpleDivision.java Can be fixed by typecasting: (double)1/