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
Is void a return type?
What’s the difference between callable and runnable?
How do singleton patterns work?
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
What is factor r?
Is there a sort function in java?
Can a static class have a constructor?
What is split return?
Write a program to print count of empty strings in java 8?
What is data object example?
What is fundamental datatype?
Difference between current previous versions of Java?
What are the 6 functions?
What do you understand by private, protected and public?
What is the purpose of the finalize() method?