CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider an operation of addition . For two numbers, the operation will generate a sum. If the operands are strings, and the same operation would produce a third string by concatenation. This feature is called -

A
Inheritance
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Encapsulation
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Polymorphism
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
Binding
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C Polymorphism

For two numbers, the operation will generate a sum. If the operands are strings, and the same operation would produce a third string by concatenation. This feature is called polymorphism.

Polymorphism means the ability to take more than one form. It allows different objects to respond to the same message in different ways. It is the ability for a message or data to be processed in more than one form. The same operation is performed differently depending upon the data type it is working upon.

Method overloading is an example of static polymorphism, while method overriding is an example of dynamic polymorphism.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Division of Integers
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon