當我嘗試編譯如下:「‘無效’類型這裏不允許」的錯誤(JAVA)
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)) ;
}
}
我得到這個錯誤:
obj.java:12: 'void' type not allowed here
System.out.println (printPoint (blank)) ;
^
1 error
我真的不知道該怎麼開始詢問有關此事而不是問:
- 這裏出了什麼問題?
- 這個錯誤信息是什麼意思?