employer cover photo
employer logo
employer logo

Tata Consultancy Services

Fait partie de Tata Group

Est-ce votre entreprise ?

Question d’entretien chez Tata Consultancy Services

What is the difference between function overloading and function overriding ?

Réponse à la question d'entretien

Utilisateur anonyme

11 sept. 2016

The interviewer wanted to know where to use which(by an example), so I started with function overloading giving an example of sum function to add two numbers. I told him that we can have more than one sum function for different types of input data i.e. for integers and float type data we can use function overloading. Then I came to function overriding, As soon as I started to answer that it is used in case of inheritance the interviewer stopped me and gave me remarks on my answer on his sheet(on the table).