Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return to Graceland, need help with Java 2 1

Status
Not open for further replies.

faust13

Programmer
Aug 7, 2001
176
US
I used to program Java a couple years ago, I have recently come back to Java and found a version change (1.0 to
Java 2). Oddly, my old code doesn't seem to compile under the new version.

The error I get is:
"class HellowWorldApp is public, should be declared in a file named HelloWorldApp.java"

What is it talking about? This is the same code I wrote and executed successfully three years ago, what has changed?

Any help is welcome. ----------------------------------------
Is George Lucas Kidding...
 
Sorry, here's the code:

import java.io.*;

public class HelloWorldApp
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
} ----------------------------------------
Is George Lucas Kidding...
 
Change the name of the file where the class HellowWorldApp is stored to HellowWorldApp.java.

Funny, there was an almost identical question like this earlier today. Wushutwist
 
That was it. Thanks! (A little red in the face with embarrasment) ----------------------------------------
Is George Lucas Kidding...
 
Wushutwist was right, there was a post almost identical to this earlyer today. Looks like he beet me to it this time.
 
I might as well tell you why java has changed. Java used to be different depending on which browser you used. Netscape had it's own version, & IE had it's own version, & so on. Today Sun has begun to force browsers to use there plugin to run java, this means that instead of the version of java that you are used to (Netscape's or IE's version), you are now programing in a different version, Sun's version. Sun has done this to enshure that all browsers can open the same sites. This make your life easyer as both a programer & a web surfer. But it would have been nice if Sun had told the old java programers what they did.
 
GT500FOMOCO,

Thanks for the update. I remember some years ago programming applets, I had to require users to use Netscape to run the applets correctly. Ultimately, it was this incompatability problem that lead me (our firm) away from Java, but I'm finding I need it for component programming now. I'm glad to hear that Sun has required the standardization.

Thanks! ----------------------------------------
Is George Lucas Kidding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top