Im trying to create a random character generator but I keep getting the error "Cannot instantiate the type Random" why is this?
Here is the code:
private static char randomChar(){
Random rand = new Random(); // This is obviously the error
char c = (char)((rand.nextInt()*26)+'a');
return c;
}
Aucun commentaire:
Enregistrer un commentaire