This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center
                            
                        
                    
                
                                6年前关闭。
            
                    
我正在自学Java和我正在看的书,只是用来解释AWT。

这是我的源代码:

java.awt.*

class obj
{
    public static void main (String[]arg)
    {
        Point blank;
        blank = new Point (3,4) ;
        int x = blank.x ;
        System.out.prinln (x) ;
    }
}


这是我尝试编译时遇到的错误:

obj.java:1: 'class' or 'interface' expected
java.awt.*
^
1 error


我做错了什么? /这里出了什么问题?

最佳答案

您在一开始缺少import

import java.awt.*;

10-08 09:06
查看更多