Can u overload main()method.Give with example.

Answer Posted / manikandan [ gtec,vellore ].

yes,gothrough below code.

class test
{
public static void main(String []asdff)
{

test.a();

}
public static void main(int a,int b)
{
System.out.println("over loaded");
}
static void a()
{

test.main(1,2);
}
}

Is This Answer Correct ?    40 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you run java program without main method?

787


Can we use synchronized block for primitives?

816


Can size_t be negative?

794


Why is it called boolean?

743


What is java basic concept?

764


What is difference between add() and addelement() in vector?

1290


What interface is extended by awt event listeners?

805


Can we define private and protected modifiers for the members in interfaces?

817


Is list thread safe in java?

694


what is the constructor and how many types of constructors are used in java?

742


Explain the access modifiers for a class, method and variables?

875


What is time complexity java?

763


Describe the process as to how substring() methodology mechanisms in java.

774


How do you use equal in java?

728


List implementations of list interface?

785