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 isa relationship?
Which category the java thread do fall in?
Explain the scope of a variable.
Name some classes present in java.util.regex package.
What is a boolean in java?
What is a numeric string?
What is the difference between serial and throughput garbage collector?
Is 0 true or false?
Does java list allow null?
Can you tell me range of byte?
Explain the purpose of garbage collection in Java?
What are reference variables in java?
Is the milky way in a void?
What is method overloading in JAVA? Why is it not present in C ?
What are the legal parameters?