A
Armbrust
Gast
Hi, ich wollte mal fragen, ob häufig Methoden genutzt werden?
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
Nö, eigentlich nicht. Also ich schreib immer alles in die main, ist einfacher. Und mit labels und break/continue hat man auch noch einen guten goto-Ersatz.
Nö, eigentlich nicht. Also ich schreib immer alles in die main, ist einfacher. Und mit labels und break/continue hat man auch noch einen guten goto-Ersatz.
public static void main(String[] args) {
int a1 = 0;
trl: while (true) {
System.out.println("Is it time for trolling?");
tri: {
if (a1 != 1) {
break tri;
}
System.out.println("Not yet");
continue trl;
}
tlI: {
if (a1 != 2) {
break tlI;
}
System.out.println("Ask for instance variables first!");
continue trl;
}
trt:{
if(a1 != 3){
break trt;
}
System.out.println("Now ask for Methods!");
break trl;
}
a1++;
}
}
Stell dir vor du schreibst mit ca 20 Kollegen einer großen Business Anwendung mit ca 250.000 - 500.000 Zeilen Code...
viel spaß...