Beginner Ruby
Q23 / 100

What does "attr_accessor :name" generate for a class?

Correct! Well done.

Incorrect.

The correct answer is B) Both a getter and setter method for the @name instance variable

B

Correct Answer

Both a getter and setter method for the @name instance variable

Explanation

attr_accessor generates both a reader (getter) and writer (setter) method for the given instance variable, saving boilerplate.

Progress
23/100