StartAgain:
if(nit_arr.size() > 2)
{
System.out.println("size of list is more than 2");
j = prev.size()-2;
k = prev.size()-3;
if(nit_arr.get(j) == myChoice && nit_arr.get(k) == myChoice){
//System.out.println("Last 2 selections of nitish are same so next one should not be");
myChoice = (int )(Math.random() * 2);
goto StartAgain;
}
}
i want to regenerate a random number if last last two elements in the array lists are same and the list is having more than 2 elements in it. its not a loop to use break/continue. so how can i achieve this?