add a minjava code what can be typed right now

This commit is contained in:
Ahmad 2024-05-09 16:04:51 +02:00
parent b8f132d9da
commit 2b6a5277b5

View File

@ -0,0 +1,51 @@
public class ClassCanBeTyped {
int x;
int y;
char z;
public ClassCanBeTyped() {
this.x = 10;
int i;
for (i = 0; i < (x+1); i = i + 1) {
int j;
for (j = 0; j < this.x; j += 1) {
this.x = this.x * this.x;
break;
}
}
do{
this.y = this.y + 1;
}while (this.y < 10);
if(this.x > 10) {
this.x = 10;
} else {
this.x = 20;
}
int k = 0;
for ( k = 0; k < 10; k = k+1) {
if(k == 5) {
return;
}
}
}
public ClassCanBeTyped(int x, int y, char z) {
this.x = x;
this.y = y;
this.z = z;
}
public int getY() {
return this.y;
}
public int getX() {
return this.x;
}
public char getZ() {
return this.z;
}
}