I'm having problems when trying to compile the following code:
I first tried compiling with this code:
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}
it works as it should. Now, if I try to replace the class name for any other name, it won't work anymore, as it seems to always look after HelloWorldApp. I made sure the file is being saved and so, I even reopened Eclipse. Still the same error. Maybe this is a common problem, with a small work-around?
Thanks
edit: I see what you guys mean, but why does it work when I have the file name as "Main.java" and a class name of "HelloWorldApp" ?