
public class MainCls { public static void main(String argv) { System.out.println("My text"); } }

The above code gives following error:
java.lang.NoSuchMethodError: main
This error occurs because you haven't specify string array in main method.
We have corrected your code:
public class MainCls {
public static void main(String []argv) {
System.out.println("My text");
}
}
It gives following output:
My text
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.