Hello everyone,
I am new to Java and just started coding. I wrote first class which failed to compile
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:
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