lundi 25 mai 2015

How to generate random number in NetBeans?

I'm trying to generate a random between 1 and 100 in NetBeans, but what I used before in Eclipse isn't working. I can't seem to use Random, as it is underined in red: "cannot find symbol." Please show me how.

Random x = new Random();
int n = x.nextInt(100);//random number 1-100




Aucun commentaire:

Enregistrer un commentaire