How do you use Math.random to generate random ints?
My code is:
int abc= (Math.random()*100); System.out.println(abc);
All it print
As an alternative, if there's not a specific reason to use Math.random(), use Random.nextInt():
Math.random()
import java.util.Random; Random rnd = new Random(); int abc = rnd.nextInt(100); // +1 if you want 1-100, otherwise will be 0-99.