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
What's the difference between comparison done by equals method and == operator?
When do we use hashset over treeset?
What is the use of list in java?
please send me hr interview questions in it industry
What is the diffrence between inner class and nested class?
What does jenkins do?
who can i handle multiple client in RMI
What's the purpose of using break in each case of switch statement?
What is singleton service?
Can we overload the main() method?
What class allows you to read objects directly from a stream in java programming?
What is double checked locking in singleton?
Can long be null in java?
Write a program to print 15 random numbers using foreach of java 8?
How to create an interface?