
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















Type Description Example of Literals int integers (whole numbers) 42 , 60634 , -8, 0 double real numbers 0.039, -10.2, 4.2E+ char single characters 'a', 'B', '&', '6' boolean logical values true, false
Type Storage Range of Values byte 8 bits -128 to 127 short 16 bits -32,768 to 32, int 32 bits -2,147,483,648 to 2,147,483, long 64 bits -9x 18 to 9x 18 float 32 bits ± 10
to ± 10 308 , 15 significant digits
int numDimes; double length; char courseSection; boolean done; String lastName;
int numDimes = 4; double length = 52.3; char courseSection = 'J'; boolean done = true; String lastName = "Reid-Miller"; int count = 3 + 2;
int a = 40; double x = 40.0; int b = 6; double y = 6.0; int c; double z; c = a / b; 6 c = a % b; 4 z = x / y; 6.66666667 c = b % a; 6 c = b / a; 0 c = 0 % a; 0 z = y / x; 0.15 c = b % 0; error c = 0 / a; 6 c = a / 0; error