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 an anonymous class in java?
What is a nonetype?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
What is indexof?
What is string in java with example?
Differece between class and generic class?
What state is a thread in when it is executing?
What is difference between iterator and enumeration in java?
What are the two categories of data types in the java programming language?
What are selection structures?
What is difference between static variable and global variable?
How listener identify that the event came from a particular object?
Does java vector allow null?
What is anonymous inner class?
Why java uses the concept of the string literal?