+ 1
How can I make random numbers?
I want to make a project using random numbers.
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....
0
You can use the class Random too. Search my code "Find Number "
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);