Variables and Data Types Flashcards
1
Q
Int
A
4 bytes
-2^31 to (2^31)-1
2
Q
Short
A
2 bytes
-2 ^15 to (2^15)-1
3
Q
Long
A
8 bytes
-2^63 to (2^63)-1
4
Q
Byte
A
1 byte
-2^7 to (2^7)-1
5
Q
Char
A
2 bytes
\u0000 to \uffff
6
Q
Boolean
A
1 bit
True, false
7
Q
Double
A
8 bytes
1.7e-308 to 1.7e+308
8
Q
Float
A
4 bytes
3.4e-38 to 3.4e+38
9
Q
Variable types that are integer
A
Byte, char, short, int, long
10
Q
Variable types that are floating
A
Float and double
11
Q
What characters can be used in variable names
A
$ and _
12
Q
What is scope
A
Where in the program a variable is visible/accessible, starts when the variable is declared and it ends at the curly bracket
13
Q
What is the relationship between the size of an integer data type and it’s minimum and maximum values
A
Minimum = 2^(bits - 1)
Maximum = (2^(bits - 1)) - 1