I am trying to develop Tic Tac Toe game where player 1 will click one button to put "X" and later player 2(Computer) will put "O" to other buttons randomly on first step.For that I need to create a random number between 0-8 except the one clicked by player 1.
I am using following code to generate random number
Random random=new Random();
int number=random.nextInt(9);