you are importing java.util
package. That's why its giving error. there is a random()
in java.util
package too. Please remove the import statement importing java.util
package. then your program will use random()
method for java.lang
by default and then your program will work. remember to cast it i.e
int x = (int)(Math.random()*100);