Hi,
I have written a simple program that simulates the Lottery draw using the Math.random() method. However i want to implement a mechanism that when i run the program, each random number is displayed in time lapses of five seconds rather than all at one. I have heard about a Sleep() method which could do this but i don't know how to use it. Can anyone help me with this implementation? Below is the code for the program.
[code]
import corejava.*;
public class Lotto
{
public static void main(String[] args)
{
String pause;
int i;
System.out.println(" TODAY'S LOTTERY NUMBERS");
System.out.println();
for (i=1; i<=6; i++)
{
int j = (int) (Math.random() * 48) + 1;
System.out.print(" " + j);
}
System.out.println();
pause = Console.readString("Press ENTER Key to exit");
}
}
[/code]