answersLogoWhite

0


Best Answer

Practically speaking, there is no advantage in overloading the main method because, eitherways the main method of the current class only gets executed and not any of the parent classes, the current class might extend.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is advantage of overloading main method?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is constructor overloading same as method overloading.yes or no. explain?

yes,because in constructor overloading constructor have same and different parameter list. In method overloading method have same name and different parameter list.


What is method overloading and constructor overloading explain with?

method overriding :method overriding means redefine methods in sub classes they already defined in the Super classes.method overloading : It means methods with the same name but with a different signature exist in one class


How the compiler compiles overloaded method?

method overloading occurs when we use two functions or more with the same name.In function overloading compiler detect which method is call actually throw the parameters passed to the methods.In function overloading parameters of functions are different.


Differene betwee constructor overloading same as method overloading?

A constructor is just a special form of a method. You can overload constructors in the exact same way as you can overload any other method.


What is method overriding and overloading in java?

Overloading is the means by which we can provide two or more different definitions of the same method in the same namespace. Overriding is the means by which a derived class may redefine the meaning of a base class method.


Is it possible to do method overloading and overriding at a time?

no we cannot do both at the same time because overloading requires different arguments and overriding dosenot


What is the main advantage of T streak?

The main advantage of T- streak method: 1. To get a very good isolated colonies.2. To obtain pure culture from mixed culture.


Define method overloading and write two method headers that together exhibit overloading?

Method overloading is when two or more methods have the same name, but the computer can differentiate between the methods by looking at the parameters. Example: public static void go(int x) public static void go(double x) If you pass an int, the first method would be called. If you pass a double, the second method would be called


What is the difference between polymorphism and method overloading in java?

The dictionary definition of polymorphism refers to a principle in biology in which an organism or species can have many different forms or stages. This principle can also be applied to object-oriented programming and languages like the Java language. Subclasses of a class can define their own unique behaviors and yet share some of the same functionality of the parent class.Overriding and Overloading are two techiques to achive polymorphism in Java.Method overloading: When a method in a class having the same method name with different arguments is said to be method overloading. Method overriding : When a method in a class having the same method name with same arguments is said to be method overriding.


How you compare and contrast overloading and overriding methods in java?

Method overloading is when you have multiple methods in a class that have the same name but a different signature. Method overriding is similar to method overloading, with a small difference. In overriding, a method in a parent class is overridden in the child class. The method in the child class will have the same signature as that of the parent class. Since the method in the child class has the same signature & name as the method of its parent class, it is termed as overriding. In situations where you may have to explicitly call the parent class method you can use the "super" keyword and for explicitly calling the current objects method you can use the "this" keyword.


Is overloading done at compile time or run time?

Overloading will be done at compile time itself. Proof: If you try to narrow down the access modifier for a method from public in the parent class to private in the child class while overloading, the compiler will not let you do it.


What does overloading rely on to identify the correct method?

If more than one method shares the same name, the number of arguments provided is used to identify the correct method.