Whats wrong with my Random?
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-04-22T21:02:30Z
Indexed on
2010/04/22
21:03 UTC
Read the original article
Hit count: 250
Here's my import statement:
import java.util.*;
Here it is in main:
Random Rand = new Random() ;
Here it is in a public void method :
int a - 0 ;
while (!done)
{
int a = Rand.nextInt(10) ;
if (debug) stuff ;
if (possibles[a]==1) done = true ;
}
Here's the error message i get:
TicTacToe.java:85: cannot find symbol
symbol : method nextInt(int)
location: class Rand
a = Rand.nextInt(10) ;
^
Whats going wrong here? it seems like i've done everything right to me.
© Stack Overflow or respective owner