Every .java file needs a "public class" inside it in order to compile and the file needs to have the same name as the public class (case sensitive).
On May 10, 11:20 pm, "[email protected]" <[email protected]> wrote: > when i type code-1.10:Hello.java by notepad and save to Hello.java > then run by "Command Prompt" , command "C:\Program Files\java > \jdk1.6.0_13\bin\javac C:\myjavaprograms\Hello.java" > > this step have 1 erros : > C:\myjavaprograms\Hello.java:2: class Hello is public , should be > declared in a filesd named Hello.java > > When i replace the first line "public class Hello{" by "class Hello > {" , it create Hello.class > > pls tell me why ? --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
