我的程序是:
import java.applet.*;
import java.awt.*;
public class boy extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.red);
g.drawString("我一边喝着咖啡,一边学Java呢",2,30);
g.setColor(Color.blue);
g.drawString("我学得很认真",10,50);
}
}
保存文件是:boy extends Applet.java
环境变量是已经运行通过的。
E:/chen>javac boy extends Applet.java
javac: invalid flag: boy
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are us
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options