View Single Post
  #1 (permalink)  
Old 01-14-2008, 10:54 AM
gapper gapper is offline
Member
 
Join Date: Jan 2008
Posts: 17
gapper is on a distinguished road
Unable to compile
Hello everyone,

I am new to Java and just started coding. I wrote first class which failed to compile

Code:
public class MainClass { public static void main(String[] args) { System.out.println("Hello World"); } }
I tried to compilie it using javac command from the console but got this error message:

Code:
Test.java:5: class MainClass is public, should be declared in a file named MainClass.java
I hope I have provided sufficient information. Kindly look into this.

- Gapper
Reply With Quote
Sponsored Links