Can u overload main()method.Give with example.
Answer Posted / rama krishna dwadasi
Yes, We can overloaded main method also,,,,but JVM start
execution from main method with parameters of String args[]
only...so below example output is "Inside second method"
Example:
public class OverloadMain {
public static void main(int a[]) {
System.out.println("Inside first Main Method");
}
public static void main(String args[]) {
System.out.println("Inside Second Method");
}
}
| Is This Answer Correct ? | 51 Yes | 5 No |
Post New Answer View All Answers
What is google full form?
Can you explain the final method modifier?
what is interface in java? Explain
Java is pass by value or pass by reference? Explain
Can a top level class be private or protected?
Is array an object in java?
What is a class variable?
What is meant by 'bit masking' in java?
What about static nested classes in java?
How do you create a first line indent?
What are the advantages of encapsulation in java?
What is method in research paper?
How do you sort arrays in java?
Where can I find jdk in my computer?
What is a nullable field?