CS118 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the 3 types of variables and explain?

A

Local-stored within method
Static-Variable shared amongst all instances of class not instance specific
Instance-Instance specific variable

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

What are the java numeric data types and their size

A

Byte 1 byte
Short 2 byte
Int 4 byte
Long 8 byte

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

What are the decimal data types?

A

float 32 bit
double 64 bit

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

What the remaining two data types?

A

Boolean and char

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

How to use ternary operator?

A

value=(boolean condition)?value if true:if false

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