samedi 19 novembre 2016

Array mit Zufallszahlen - Anfänger - Hilfe

samedi 19 novembre 2016
Hallo, ich bin ein blutiger Anfänger und ich bitte um Verständnis.
Meine Programmierung sieht so aus:

public class randomarray
{
public static void main (String []args) {

int wert = 0;
int [] a = new int [10];

for(int i=0; i <10; i++) {

a= (int)Math.random();
System.out.print(a
);
}
}
}


Der Ausgabewert ist 10x die 0... Wo liegen die Fehler?


Array mit Zufallszahlen - Anfänger - Hilfe

0 commentaires:

Enregistrer un commentaire

 
◄Design by Pocket