Im trying to generate random numbers using the statement:
Random r = new Random(2);
for (int i=1;i<=18;i++)
but im having errors in my results here is my entire code so far:
import java.util.*;
public class Random4
{
public static void main(String []args)
{
Random r = new Random(2);
for (int i=1;i<=18;i++)
{
int n=r.nextInt(19);
switch(n)
{
case 1:
System.out.println("n is a multiple of 3");
break;
case 2:
System.out.println("n is a multiple of 4");
break;
case 3:
System.out.println("n is a multiple of 5");
break;
default:
System.out.println("Chill dude");
break;
}
System.out.println(n);
}
}
}
Whats wrong with it?