When I try to compile this:
import java.awt.* ;
class obj
{
public static void printPoint (Point p)
{
System.out.println ("(" + p.x + ", " + p.y + ")");
}
public static void main (String[]arg)
{
Point blank = new Point (3,4) ;
System.out.println (printPoint (blank)) ;
}
}
I get this error:
obj.java:12: 'void' type not allowed here
System.out.println (printPoint (blank)) ;
^
1 error
I don't really know how to start asking about this other than to ask:
- What went wrong here?
- What does this error message mean?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…