mardi 24 mars 2015

How Can I use array to make multiple output?

When I write System.out.print(dice); the output is randomly generated number like this:


[3|4|7|6|6]


How Can I use array to have multiple values?


/** * This program rolls Yahtzee! dice 1,000,000 times, recording the number of * Yahtzees which occur. After the trials statistics are produced. */



/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code your application logic here
Scanner input = new Scanner(System.in);
Random generator = new Random();
YahtzeeDice dice = new YahtzeeDice(generator);
System.out.print(dice);
}

}

Aucun commentaire:

Enregistrer un commentaire