Primitive Data Types OCA Review Notes

Date Posted:

The exam assumes you are well versed with this 8 datatypes and their relative sizes and what can be stored in them.

java has 8 datatypes

byte -> -128 to 127

don’t memorize the max. allowed or min.

you won’t convert b/w number systems on the exam.

you can add _ underscores b/w numbers except begin/end same in decimal ex. 1.1

defaults
numbers : int
decimals : double

int num = 1_234_567_890;
long longNum =  4_234_567_890L;
float f = 123.2f;
double d = 123.2;

cast or add litterals if initializing

Primitive types assign to null will give compile error

int num=null;
long distance=null;
float money=null;
double savings=null;