+ 1

How can I make random numbers?

I want to make a project using random numbers.

7th Oct 2016, 6:23 PM
Daniel Stepanek
Daniel Stepanek - avatar
3 Réponses
+ 3
if you want you can use int x = (int)(Math.random()*100); for two digit random number and for three digit replace 100 by 1000 and so on....
7th Oct 2016, 7:34 PM
Akshat Pandey
Akshat Pandey - avatar
0
You can use the class Random too. Search my code "Find Number "
7th Oct 2016, 10:16 PM
Wanderlei Borges
Wanderlei Borges - avatar
0
import java.until.random; public class Randy { public static void main(String arts[]){ Random rand = new Random(); int x = rand.nextInt(4); system.out.println(x);
8th Oct 2016, 11:55 AM
jerry
jerry - avatar