Variables and Data Types Flashcards

1
Q

Int

A

4 bytes
-2^31 to (2^31)-1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Short

A

2 bytes
-2 ^15 to (2^15)-1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Long

A

8 bytes
-2^63 to (2^63)-1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Byte

A

1 byte
-2^7 to (2^7)-1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Char

A

2 bytes
\u0000 to \uffff

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Boolean

A

1 bit
True, false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Double

A

8 bytes
1.7e-308 to 1.7e+308

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Float

A

4 bytes
3.4e-38 to 3.4e+38

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Variable types that are integer

A

Byte, char, short, int, long

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Variable types that are floating

A

Float and double

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What characters can be used in variable names

A

$ and _

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly