Professional Documents
Culture Documents
n g
i
m
a m
o gr
P r
e d
nt
rie
c tO
e
bj
O
Java source
code Java
bytecode
Java
compiler
Bytecode Bytecode
interpreter compiler
Machine
code
write and
save program
errors
errors
Compile program
//dataType identifier;
int x;
int y = 10;
int z, zz;
double a = 12.0;
boolean done = false, prime = true;
char mi = 'D';
stick with int for integers, double for real
numbers
int total;
int count, temp, result;
int sum = 0;
int base = 32, max = 149;
total = 55;
sides = 12;
System.out.println ("A dodecagon has " + sides + "
sides.");
}
}
object method
information provided to the method
name
(parameters)
if (x == 1) switch (x) {
y = 4; case 1:
y = 4;
if else (x == 2)
break;
y = 9; case 2:
else y = 9;
y = 22; break;
Is the same as… default:
y = 22;
}