2
The real problem you should note in the first line of error:
Random is already defined in this Compilation Unit
You gave Random’s name to your class, and the compiler is confusing it with the java.util.Random
. Like you don’t have the method nextInt()
defined in his class he says that this method does not exist.
Change the name of your class to avoid conflicts that is to work OK.
See an example working on Ideone.
Thank you very much! it was exactly that in 5 minutes I qualify the answer (y)
– David Christian Dias Ordone