java error
- From: Alex5222@xxxxxxxxxxxxx
- Date: 26 Jul 2005 15:09:07 -0700
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);
}
}
.
- Follow-Ups:
- Re: java error
- From: blmblm
- Re: java error
- Prev by Date: Re: C++ different learning styles
- Next by Date: Re: Why not unions
- Previous by thread: C++ different learning styles
- Next by thread: Re: java error
- Index(es):
Relevant Pages
|