Question :Can we overload main method in java? (CoreJava)
Answer :Yes. But the main method with String args[] is called when you call the
programme (java Test1) Have a look at this demo. public class Test1
{
public static void main(String[] args)
{
System.out.println("in main method");
}
public static void main(String args[],String arg)
{
System.out.println("in overload method");
}
}
No comments:
Post a Comment