Java:
public static void main(String[] args) {
// TODO code application logic here
int[] zahlen = new int[7];
Random random = new Random();
for(int i = 0; i < zahlen.length; i++)
++zahlen[1+random.nextInt(6)];
}
for(int a: zahlen){
System.out.println(a);
}
}
Ich qäule mich jetzt seit ca 30 Minuten mit der Frage, warum der for-each loop im o.g. Programm nicht funktionier. Kann mir vielleicht jemand helfen?
Vielen Dank!