java error



I've just started programming in java and when I try to compile the
hello world program that came off of the java tutorial and it gave me
the following error:

helloworldapplet.java:8: class HelloWorld is public, should be declared
in a file named HelloWorld.java
public class HelloWorld extends Applet {
^
1 error

Here's the code for that program:

import java.applet.*;
import java.awt.*;

/**
* The HelloWorld class implements an applet that
* simply displays "Hello World!".
*/
public class HelloWorld extends Applet {
public void paint(Graphics g) {
// Display "Hello World!"
g.drawString("Hello world!", 50, 25);
}
}

.



Relevant Pages

  • java error
    ... helloworldapplet.java:8: class HelloWorld is public, ... public class HelloWorld extends Applet { ...
    (comp.programming)
  • java error
    ... helloworldapplet.java:8: class HelloWorld is public, ... public class HelloWorld extends Applet { ...
    (comp.programming)
  • Re: java error
    ... >I've just started programming in java and when I try to compile the ... >helloworldapplet.java:8: class HelloWorld is public, ... >public class HelloWorld extends Applet { ...
    (comp.programming)
  • applets being cached?
    ... I compiled a file - HelloWorld.java - and then included it on a webpage ... public class HelloWorld extends Applet { ... The browser I'm using is FireFox. ...
    (comp.lang.java.programmer)