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
What is java and why do we need it? Explain
Why do we need variables?
What is the different types of functions?
What is array sorting in java?
What is difference between final and immutable?
How many types of threads are there in java?
What is the use of java?
What do you mean by pointer value and address?
Why do we need strings in java?
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?
What are three advantages of using functions?
How do you break a loop?
Explain the difference between comparator and comparable in java?
What is data structure in java?
What is finally in Java?