Ich verstehe nicht wieso die Blöcke unterschiedliche Ausgaben verursachen:
Sorte 1:
public class Programm{
public static void main(String[]args){
for(int i = 1; i <= 5; i++){
for(int j = 1; j <= i; j++){
System.out.print("*" + " ");
System.out.println();
}
}
}
}
und Sorte 2:
public class Programm{
public static void main(String[]args){
for(int i = 1; i <= 5; i++){
for(int j = 1; j <= i; j++)
System.out.print("*" + " ");
System.out.println();
}
}
}
Wieso bekomm ich eine andere Ausgabe wenn ich in die Schleife noch einen Block reinsetze?
Vielen Dank im Voraus.
Sorte 1:
public class Programm{
public static void main(String[]args){
for(int i = 1; i <= 5; i++){
for(int j = 1; j <= i; j++){
System.out.print("*" + " ");
System.out.println();
}
}
}
}
und Sorte 2:
public class Programm{
public static void main(String[]args){
for(int i = 1; i <= 5; i++){
for(int j = 1; j <= i; j++)
System.out.print("*" + " ");
System.out.println();
}
}
}
Wieso bekomm ich eine andere Ausgabe wenn ich in die Schleife noch einen Block reinsetze?
Vielen Dank im Voraus.