CS118 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
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
3
Q
What are the decimal data types?
A
float 32 bit
double 64 bit
4
Q
What the remaining two data types?
A
Boolean and char
5
Q
How to use ternary operator?
A
value=(boolean condition)?value if true:if false