public class ChooseBall{
public int redBall(){ int red=(int)(Math.random()*42); return red;}public int whiteBall(){ int white=(int)(Math.random()*7); return white;}public static void main(String[] args) { int [] wb=new int[5]; int rb; ChooseBall ball=new ChooseBall(); for(int i=0;i<5;i++){ wb[i]=ball.whiteBall(); System.out.println("############"+wb[i]); for(int j=1;j<5;j++){ while(wb[i]==wb[j]){ wb[i]=ball.whiteBall(); System.out.println("!!!!!!!!!!!!!!!!!!!"+white); break; } wb[i]=ball.whiteBall(); System.out.println("%%%%%%%%%%"+wb[i]); } System.out.println("White:"+wb[i]); } rb=ball.redBall(); System.out.println("Red:"+rb);}}