Endabgabe #20

Merged
i22035 merged 137 commits from Endabgabe into main 2024-07-05 11:59:47 +00:00
38 changed files with 248 additions and 0 deletions
Showing only changes of commit 85e0cf3807 - Show all commits

View File

@ -0,0 +1,12 @@
class Char {
char a;
public Char(char a){
this.a = testMethod(a);
}
char testMethod(char a){
return a;
}
}

View File

@ -0,0 +1,8 @@
/*
Mutliple Line Comment. Ignore
*/
class Comments{
private int a; // Ignore
}

View File

@ -0,0 +1,12 @@
public class ConstructorMethodCall {
int a;
public ConstructorMethodCall(){
this.a = testMethod();
}
int testMethod(){
return 1;
}
}

View File

@ -0,0 +1,12 @@
class ConstructorMethodCallParameters {
int a;
public ConstructorMethodCallParameters(int a){
this.a = testMethod(a);
}
int testMethod(int a){
return a;
}
}

View File

@ -0,0 +1,5 @@
class ConstructorParameter {
public ConstructorParameter(int a, int b){
}
}

View File

@ -0,0 +1,8 @@
class ConstructorThisDot {
private int a;
public ConstructorThisDot(int a){
this.a = a;
}
}

View File

@ -0,0 +1,10 @@
class DoWhile{
public DoWhile(){
int i = 0;
do{
i++;
}while(i < 10);
}
}

View File

@ -0,0 +1 @@
class EmptyClass {}

View File

@ -0,0 +1,5 @@
public class EmptyClassWithConstructor {
public EmptyClassWithConstructor() {
}
}

View File

@ -0,0 +1,3 @@
class Field {
int a;
}

View File

@ -0,0 +1,3 @@
public class FieldWithAccessModifier {
public int a;
}

View File

@ -0,0 +1,8 @@
class For{
public For(){
for(int i = 0; i < 10; i++){
int a;
}
}
}

View File

@ -0,0 +1,8 @@
public class If {
public If() {
int intValue = 5;
if(intValue == 5) {
intValue--;
}
}
}

View File

@ -0,0 +1,10 @@
public class IfElse {
public IfElse() {
int intValue = 5;
if(intValue == 5) {
intValue--;
} else {
intValue++;
}
}
}

View File

@ -0,0 +1,12 @@
public class IfElseIfElse {
public IfElseIfElse() {
int intValue = 5;
if(intValue == 5) {
intValue--;
} else if(intValue ==4) {
intValue++;
} else {
intValue++;
}
}
}

View File

@ -0,0 +1,12 @@
public class Increment {
public int test;
public void increment(int p) {
test = p++;
for(int i = 1; i<=10; i++) {
int a = 5;
}
}
}

View File

@ -0,0 +1,5 @@
class MainMethod{
public static void main(String[] args) {
}
}

View File

@ -0,0 +1,3 @@
class MultipleClasses {}
class TestClass2{}

View File

@ -0,0 +1,8 @@
class Null{
Null a;
public Null(){
this.a = null;
}
}

View File

@ -0,0 +1,18 @@
class SelfReference{
SelfReference selfReference;
int testMethod1() {
return this.testMethod2();
}
int testMethod2() {
return 1;
}
int testMethod3(){
SelfReference selfReference1 = new SelfReference();
return selfReference1.selfReference.testMethod1();
}
}

View File

@ -0,0 +1,8 @@
class ThisDot {
public int a;
public ThisDot() {
this.a = 1;
}
}

View File

@ -0,0 +1,34 @@
class VariableCalculation{
int aPlusB(int a, int b){
return a + b;
}
int aMinusB(int a, int b){
return a - b;
}
int aTimeB(int a, int b){
return a * b;
}
int aDivB(int a, int b){
return a / b;
}
int complexCalc (int a, int b){
return a * b / 1 * 3;
}
boolean aSmallerB (int a, int b){
return a < b;
}
boolean aGreaterB (int a, int b){
return a > b;
}
boolean aEqualsB (int a, int b){
return a == b;
}
}

View File

@ -0,0 +1,30 @@
class VariableCompare{
boolean trueMethod() {
return true;
}
boolean falseMethod(){
return false;
}
boolean trueAndTrueMethod(){
return true && true;
}
boolean trueAndFalseMethod(){
return true && false;
}
boolean falseAndFalseMethod(){
return false && false;
}
boolean trueOrTrueMethod(){
return true || true;
}
boolean falseOrFalseMethod(){
return false || false;
}
}

View File

@ -0,0 +1,3 @@
class VoidMethod{
void test(){}
}

View File

@ -0,0 +1,10 @@
class While{
public While(){
int i = 10;
while ( i > 0){
i--;
}
}
}