Category: 6. OOPs Concepts: Method Overloading Interview
-
Can we overload the methods by making them static?
No, We cannot overload the methods by just applying the static keyword to them(number of parameters and types are the same). Consider the following example. Output
-
Why is method overloading not possible by changing the return type in java?
In Java, method overloading is not possible by changing the return type of the program due to avoid the ambiguity. Output:
-
What is method overloading?
Method overloading is the polymorphism technique which allows us to create multiple methods with the same name but different signature. We can achieve method overloading in two ways. By Changing the number of arguments By Changing the data type of arguments Method overloading increases the readability of the program. Method overloading is performed to figure…