Ayuda con numeros aleatorios
Hola tengo este codigo:
import java.io.*;
import java.util.Random;
import java.lang.Math;
public class PruebaRandoms{
double x;
//Random rnd=new Random();
public void main( String args[ ] ) throws IOException {
x=0;
//for (int i = 0; i < 10; i++) {
x =Math.random();//rnd.nextDouble();
System.out.println(x);
//}
}
}
lo compila bien pero al ejecutarlo me da este error
import java.io.*;
import java.util.Random;
import java.lang.Math;
public class PruebaRandoms{
double x;
//Random rnd=new Random();
public void main( String args[ ] ) throws IOException {
x=0;
//for (int i = 0; i < 10; i++) {
x =Math.random();//rnd.nextDouble();
System.out.println(x);
//}
}
}
lo compila bien pero al ejecutarlo me da este error