1
package homework1;

import java.applet.Applet;
import java.awt.Graphics;

public class Homework1A extends Applet {

    public  void paint( Graphics g ){
        g.drawString("CIS 35A Student Learning Outcomes ",40,60);
    }
}

这是我得到的警告

The serializable class Homework1A does not declare a static final serialVersionUID field of type long 
Homework1A.java    /homework1/src/homework1    line 5    Java Problem

还有另一个这样的警告

Warning: Can't read AppletViewer properties file:

但是在我运行我的代码几次后它就消失了。

4

1 回答 1

2

您将需要一个串行版本的 UID,例如:private static final long serialVersionUID = 1L;在您的班级中。

您可以将其用作参考:序列号

于 2012-10-08T02:01:13.940 回答