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.
public class Lotto
public static void main(String args)
System.out.println(" TODAY'S LOTTERY NUMBERS");
for (i=1; i<=6; i++)
int j = (int) (Math.random() * 48) + 1;
System.out.print(" " + j);
pause = Console.readString("Press ENTER Key to exit");