Skip to content

Instantly share code, notes, and snippets.

@HamsterofDeath
Created March 23, 2023 18:53
Show Gist options
  • Save HamsterofDeath/70f4dd116840b3b9023bc7442c00bba9 to your computer and use it in GitHub Desktop.
Save HamsterofDeath/70f4dd116840b3b9023bc7442c00bba9 to your computer and use it in GitHub Desktop.
package superprof;
public class Unroll {
static int zaehler = 0;
public static void main(String[] args) {
int x = 1;
// Test '1'
System.out.print('1' + "\n\r");
zaehler++;
boolean test1 = true;
while (true) {
// Test '2'
System.out.print('2' + "\n\r");
zaehler++;
boolean test2 = true;
// Check condition
if (!(test2 && (x <= 2))) {
break;
}
x++;
// Test '4'
System.out.print('4' + "\n\r");
zaehler++;
// Test '3'
System.out.print('3' + "\n\r");
zaehler++;
boolean test3 = true;
}
System.out.println("Zähler = " + zaehler);
}
static boolean test(char num) {
System.out.print(num + "\n\r");
zaehler++;
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment