Examveda
Examveda

What does polymorphism allow in Ruby?

A. Objects of different classes to be treated as objects of a common superclass

B. Objects of different classes to have the same methods

C. Objects of the same class to have different methods

D. Objects of the same class to be treated as objects of different classes

Answer: Option A


This Question Belongs to Ruby Programming >> Modules And Mixins In Ruby

Join The Discussion

Related Questions on Modules and Mixins in Ruby

What is inheritance in Ruby?

A. A mechanism by which a class can hide implementation details from another class

B. A mechanism by which a class can inherit properties and behaviors from another class

C. A mechanism by which a class can create multiple instances of another class

D. A mechanism by which a class can hide implementation details from another class

What does polymorphism allow in Ruby?

A. Objects of different classes to be treated as objects of a common superclass

B. Objects of different classes to have the same methods

C. Objects of the same class to have different methods

D. Objects of the same class to be treated as objects of different classes