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 are abstract functions?
What is null in java?
Can we call virtual funciton in a constructor ?
What is difference between equal and == in java?
What if constructor is protected in java?
how would you implement a thread pool? : Java thread
What is collection api?
Is jdk required on each machine to run a java program?
How do you replace all in word?
What is the access scope of protected access specifier?
Can we inherit inner class?
Give a practical example of singleton class usage?
What is an object class?
Is double bigger than float?
What is a consumer in java?