1.

What is the process of defining more than one method in a class differentiated by parameters?(a) Function overriding(b) Function overloading(c) Function doubling(d) None of the mentionedI have been asked this question during an interview for a job.The query is from Methods Taking Parameters topic in section Classes and Methods of Java

Answer» RIGHT answer is (b) Function overloading

To elaborate: Function overloading is a process of defining more than one METHOD in a class with same NAME differentiated by function signature i:E return type or parameters type and number. Example –int volume(int length, int WIDTH) & int volume(int length , int width , int height) can be used to calculate volume.


Discussion

No Comment Found

Related InterviewSolutions