wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes What' s wrong with this code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What Watch "What New topic
Author

What' s wrong with this code?

Michael Burke
Ranch Hand

Joined: Jul 29, 2000
Posts: 103
import java.util.*;
class Numtest {
public static void main(String args[]) {
int answer;
for (int i=0; i<20; i++) {
answer=Math.abs(new Random().nextInt()%100)+1;
println(answer);
}
}
}
Here's the error message but I don't understand what the problem is. Thanks for any help.
C:\My Documents\Numtest.java:9: cannot resolve symbol
symbol : method println (int)
location: class Numtest
println(answer);
^
1 error
Tool completed with exit code 1
Roy Tock
Ranch Hand

Joined: Jul 16, 2001
Posts: 83
Try System.out.println?
Michael Burke
Ranch Hand

Joined: Jul 29, 2000
Posts: 103
Thanks Roy, it figures it was something obvious.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What' s wrong with this code?
 
Similar Threads
compare a list array and a string
access object in a vector
Test class shows error
Please Explain?
C and Java