Vidyalelo
Ruby Programming · Q32

Inheritance and Polymorphism in Ruby

Programming · Ruby Programming · question 32

Q32

Which of the following statements best describes the purpose of the attr_accessor method in Ruby classes?

A.
It defines only a reader method for class attributes
B.
It defines only a writer method for class attributes
C.
It defines constructor methods for class attributes
D.
It defines both reader and writer methods for class attributes
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board