Can u overload main()method.Give with example.
Answer Posted / aditya sharma
* Yes we can overload the main method.
File Name :- checkOverloadingMainMethod.java
Example: -
public class checkOverloadingMainMethod {
public static void main(int a[]) {
System.out.println("Overload =>Integer Array");
}
public static void main(String args[]) {
System.out.println("Overload => String Array");
}
}
| Is This Answer Correct ? | 120 Yes | 18 No |
Post New Answer View All Answers
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?
What is the difference between the final method and abstract method?
What is ternary operator?
why are wait(), notify() and notifyall() methods defined in the object class? : Java thread
What is struts in java?
What is the difference between the paint() and repaint() methods in java programming?
What do you mean by thread safe?
Which is better ascii or unicode?
What is meant by object?
What are different exception types exceptions available in java ?
What is an eror in java?
What are the drawbacks of singleton class?
Why do we use return statement?
Explain about exception propagation?
What are the differences between stringbuffer and stringbuilder?