Term
mixed-type expressions are |
|
Definition
Having an int and a double in the same expression |
|
|
Term
Java data is arranged in a hierarchy meaning |
|
Definition
Types holding more info at the top, less at bottom |
|
|
Term
Binary operators usually are |
|
Definition
|
|
Term
Assignment and unary operators are |
|
Definition
|
|
Term
You can tell Java to “try” to store closest value this is called |
|
Definition
"cast" or "type cast" (Ex: int x = 123 byte b = (byte) x;) |
|
|
Term
Floating-point numbers represent |
|
Definition
approximations. So it can't be a .1 or 1/3 |
|
|
Term
There are shorthand versions of all binary operators: |
|
Definition
a += b; // same as a = a + b; a -= b; // same as a = a - b; a /= b; // same as a = a / b; a *= b; // same as a = a * b; a %= b; // same as a = a % b; |
|
|
Term
Increment and decrement operators are |
|
Definition
Unary operators (++, --) that add or subtract one. Can only be applied to a variable. You may use the operator before or after the variable. Both have exactly the same effect on variable. Variable is always incremented or decremented by 1. (Ex: int a = 5; ++a; // a is now 6 a++; // a is now 7) |
|
|
Term
The ++ and -- also have an |
|
Definition
|
|
Term
With post-increment (after the variable) |
|
Definition
The original value is saved temporarily The variable is updated The original value is returned as the expression's value |
|
|
Term
System.out.printf() allows us to |
|
Definition
|
|
Term
|
Definition
Placeholders or format specifiers for each variable |
|
|
Term
|
Definition
%, followed by variable type. You must provide a variable for each specifier (Ex: %f for reals, %d for integers, %s for string) |
|
|
Term
Specifiers are fine tuned by using |
|
Definition
width, precision, and flags (Ex: "%5d" – integer right-aligned in a 5 character field "%5.2f" – real with 2 digits of precision, 5-wide "%-20s" – string left aligned in a field 20 wide "%,d" – integer with thousands separator |
|
|
Term
In Java programming, functions: |
|
Definition
Are named blocks of code declared inside a class Accept (take) one or more parameters (inputs) Return a single value of a specific type |
|
|
Term
|
Definition
NOT passed explicitly as parameters. These are called instance methods
S.length(); --- OK String.length(s); ----NOT OK |
|
|
Term
Don't use a semi-colon when |
|
Definition
|
|
Term
|
Definition
new String objects by transforming, (applying a rule), to existing ones |
|
|
Term
|
Definition
s.replace("a","b"). Very useful for scrubbing user input. |
|
|
Term
Each type has a class (object) type that "shadows" it. These are called |
|
Definition
the wrapper types. Provide convenient methods for working with types |
|
|
Term
Turning Strings into numbers is known as |
|
Definition
|
|
Term
Coordinates used for x,y represent |
|
Definition
"Points" or infinitely small location located between pixels (Ex: points 2,2 and 6,6) |
|
|
Term
Shape-drawing methods come in two varieties |
|
Definition
Those that draw an outline. Those that fill an area. |
|
|