In this unit you learned about the three primitive data types on the exam: int, double, and boolean. You also learned how to declare (name) and change the value of variables. You learned about operators, casting, and integer constants for the min and max integer values.
Declare a Variable - Specifying the type and name for a variable. This sets aside memory for a variable of that type and associates the name with that memory location.
Camel case - One way to create a variable name by appending several words together and uppercasing the first letter of each word after the first word (myScore).
using the wrong type for a variable. Donβt forget that using integer types in calculations will give an integer result. So either cast one integer value to double or use a double variable if you want the fractional part (the part after the decimal point).
using == to compare double values. Remember that double values are often an approximation. You might want to test if the absolute value of the difference between the two values is less than some amount instead.
assuming that some value like 0 will be smaller than other int values. Remember that int values can be negative as well. If you want to set a value to the smallest possible int values use Integer.MIN_VALUE.