From 3500ffd377f1b34d3dd3c0c3a77d8a41adf010e1 Mon Sep 17 00:00:00 2001 From: Lucas <89882946+notbad3500@users.noreply.github.com> Date: Mon, 1 Jul 2024 23:31:22 +0200 Subject: [PATCH] small changes --- .../input/AllFeaturesClassExample.java | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/test/resources/input/AllFeaturesClassExample.java b/src/test/resources/input/AllFeaturesClassExample.java index 1a8493d..73121ee 100644 --- a/src/test/resources/input/AllFeaturesClassExample.java +++ b/src/test/resources/input/AllFeaturesClassExample.java @@ -9,42 +9,25 @@ public class AllFeaturesClassExample { this.b = b; this.c = c; } - private class InnerClass { - void innerMethod() { - System.out.println("Inner class method"); - } - } // Methode zur Demonstration von Kontrollstrukturen void controlStructures() { // if-else Anweisung if (a > 10) { - System.out.println("a ist größer als 10"); + // System.out.println("a ist größer als 10"); } else { - System.out.println("a ist nicht größer als 10"); + // System.out.println("a ist nicht größer als 10"); } // while Schleife while (a > 0) { - System.out.println("a ist " + a); + // System.out.println("a ist " + a); a--; } // for Schleife for (int i = 0; i < 5; i++) { - System.out.println("for Schleife Iteration: " + i); - } - - // switch Anweisung - switch (c) { - case 'a': - System.out.println("c ist ein 'a'"); - break; - case 'b': - System.out.println("c ist ein 'b'"); - break; - default: - System.out.println("c ist nicht 'a' oder 'b'"); + // System.out.println("for Schleife Iteration: " + i); } } @@ -52,15 +35,28 @@ public class AllFeaturesClassExample { void logicalOperations() { // Logische UND-Operation if (b && a > 5) { - System.out.println("a ist größer als 5 und b ist wahr"); + // System.out.println("a ist größer als 5 und b ist wahr"); } // Logische ODER-Operation if (b || a < 5) { - System.out.println("b ist wahr oder a ist kleiner als 5"); + // System.out.println("b ist wahr oder a ist kleiner als 5"); } } + void mathOperations() { + // Addition + int sum = a + 5; + // Subtraktion + int difference = a - 5; + // Multiplikation + int product = a * 5; + // Division + int quotient = a / 5; + // Modulo + int remainder = a % 5; + } + public static void main(String[] args) { AllFeaturesClassExample obj = new AllFeaturesClassExample(12, true, 'a'); obj.controlStructures();