Question-37: What is method overloading?
Answer:
If a class have multiple methods by same name but different parameters, it is known as Method Overloading. It increases the readability of the program.
Question-38: Why method overloading is not possible by changing the return type in java?
Answer:
Because of ambiguity
Question-39: Can we overload main() method?
Answer:
Yes, of-course! You can have many main() methods in a class by overloading the main method.
Answer:
If a class have multiple methods by same name but different parameters, it is known as Method Overloading. It increases the readability of the program.
Question-38: Why method overloading is not possible by changing the return type in java?
Answer:
Because of ambiguity
Question-39: Can we overload main() method?
Answer:
Yes, of-course! You can have many main() methods in a class by overloading the main method.
No comments:
Post a Comment