Code:-
public class test1
{
public static void Main(String args[]) // here main method starts with capital letter (like Main)
{
System.out.println("Testing Main Method");
}
}
This program will compile but does not run. IT give a runtime error: "main method not found in test1 class"
Solution: change the capital m to small case letter (main).
public class test1
{
public static void Main(String args[]) // here main method starts with capital letter (like Main)
{
System.out.println("Testing Main Method");
}
}
This program will compile but does not run. IT give a runtime error: "main method not found in test1 class"
Solution: change the capital m to small case letter (main).
Comments
Post a Comment