This is a subset of Java. Imprementing its interpreter, I deepen my understanding.
- declaration
- substitution
- single class
- method with none argument
- int and boolean value
- binary operation
- if statement
- while statement
- input from one file
- simple method calling
-
outis abbreviation ofSystem.out.println - type checking before executing
class Test {
void main() {
int x;
x = x + 1;
out(x);
if (x == 0) {
x = x - 2;
} else if (x == 1) {
x = x + 1;
} else if (x == 2) {
x = x + 3;
} else {
x = 100;
}
out(x);
show();
int y;
while (y<100) {
y = y + 1;
}
out(y);
}
void show() {
out(3);
out(true);
out(2525252);
}
}