wrote more Testfiles and created files for abstract syntax

This commit is contained in:
JonathanFleischmann 2024-05-02 11:17:37 +02:00
parent a1cc591220
commit 2595d5de08
11 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,3 @@
//public class ClassWithAssignment {
// int x = 10;
//}

View File

@ -0,0 +1,11 @@
//public class ClassWithConstructor {
// int x = 10;
// public classWithConstructor() {
// this.x = 10;
// for (int i = 0; i < 6; i++) {
// for (int j = 0; j < this.x; j++) {
// this.x = this.x * this.x;
// }
// }
// }
//}

View File

@ -0,0 +1,11 @@
public class ClassWithConstructor {
int x = 10;
public classWithConstructor() {
this.x = 10;
for (int i = 0; i < 6; i++) {
for (int j = 0; j < this.x; j++) {
this.x = this.x * this.x;
}
}
}
}

View File

@ -0,0 +1,17 @@
public class ClassWithConstructorAndMethodCall {
int x = 10;
public classWithConstructorAndMethodCall() {
this.x = 10;
while (methodCall()) {
this.x = this.x * this.x;
}
}
public boolean methodCall() {
if (x > 100) {
return false;
} else {
return true;
}
}
}

View File

@ -0,0 +1,14 @@
public class ClassWithConstructorWithParameters {
int x = 0;
public classWithConstructorWithParameters(int startvalue, int repitions) {
this.x = startvalue;
while (repitions > 0) {
int innerRepititions = this.x;
while (innerRepititions > 0) {
this.x = this.x * this.x;
innerRepititions--;
}
repitions--;
}
}
}