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
Is null == null in java?
What is string builder?
What is variable explain?
What is the use of parseint in java?
What is variable explain with example?
What language is pass by reference?
What is the difference between jfc & wfc?
Can we override constructor?
What is the difference between sleep and wait in java?
What is set and get methods in java?
Explain the importance of throwable class and its methods?
Is string a wrapper class?
What is java Applet?
What are functions in java?
Is a boolean variable?