1.

What is the process of defining two or more methods within same class that have same name but different parameters declaration?(a) method overloading(b) method overriding(c) method hiding(d) none of the mentionedI had been asked this question in an internship interview.The question is from Overloading Methods & Argument Passing in chapter Classes and Methods of Java

Answer»

The correct choice is (a) METHOD overloading

For explanation I would say: Two or more methods can have same name as LONG as their parameters declaration is different, the methods are SAID to be overloaded and process is called method overloading. Method overloading is a way by which JAVA implements polymorphism.



Discussion

No Comment Found

Related InterviewSolutions