Vidyalelo
Ruby Programming · Q5

Classes and Objects in Ruby

Programming · Ruby Programming · question 5

Q5

What does the attr_accessor method do in Ruby?

A.
Creates getter and setter methods for an instance variable
Answer
B.
Creates only getter methods for an instance variable
C.
Creates only setter methods for an instance variable
D.
Creates private methods for an instance variable

Answer: Option A

Solution

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