Chapter 3 Flashcards
What are examples of keywords?
double, class, char, int, public, static
How do you define “int” and giving it a value?
import java.util.Scanner; public class NAME { public static void main (String args[]) { int a=1, b=2, c=3
What is definition of “byte”?
a group of binary digits or bits (usually eight) operated on as a unit (8 ; – 128 to 127)
What is definition of “short”?
signed 16-bit type least used (16 ; -32 thousand to 32 thousand)
What is definition of “int”?
signed 32-bit type; most common (32 ; -2 billion to 2 billion)
What is definition of “long”?
signed 64-bit type (64; 9 quintillion to 9 quintillion)
What are the binary operations?
Add, Subtract, Divide, MOD
What is the order of operations for binary?
Parenthesis, Exponents, Multiply/ Divide/MOD, Add/Subtract
What is Java real number data types?
“double” - more accurate and only one tested
“float” - not tested
Which binary arithmetic operation is something that you would not normally use?
MOD
How many bytes are there in double?
8 bytes
What does “X++” and “++X” output?
X+1
What does “+=” do?
double x = 1.3;
x += 0.1;
It takes the value of x, adds 0.1 to it, and then stores the result of (x + 0.1) back into x.
Be able to trace code using the short cuts…
GOOD LUCK!
What is “chaining”?
assign character to multiple fields
Who invented Boolean algebra?
George Boole
What is Boolean?
A true = 1
or false = 0 statement.
What is final?
A constant that cannot be changed without an error.
Mathmatial opportations for java.
Parenthesis, Exponents, Multiply/ Divide/MOD, Add/Subtract
What does an “int” number look like?
no decimal
18.564 -> 18 as an “int”
What does a “double” number look like?
decimal
18.564123 -> 18.564123 as a “double”
What is definition of “float”?
32 bits; shows decimals
half as much space as double but less precise with extremely big or small numbers.
“float” vs “int”
“float” shows decimals
“int” does not show decimals