mercredi 4 novembre 2015

Can someone tell me the code in java to get a random line of numbers?(they all have to be uniques) [duplicate]

This question already has an answer here:

here´s the part of code: Is a method,not main.

public static String generator(){
        Random gen=new Random();
        String pwrd="";
        for(int i=0;i<4;i++){
            int num=gen.nextInt(6);

            pwrd+=num;

        }
        return pwrd;




Aucun commentaire:

Enregistrer un commentaire