Examveda
Examveda

What is the significance of the initialize method in Ruby classes?

A. It defines class variables

B. It defines class methods

C. It is automatically called when a new object is created and allows initialization of instance variables

D. It defines instance methods

Answer: Option C


Join The Discussion

Related Questions on Inheritance and Polymorphism in Ruby

What is polymorphism in OOP?

A. The ability to hide implementation details

B. The ability to restrict access to certain methods

C. The ability for objects of different classes to be treated as objects of a common superclass

D. The ability to create multiple instances