1

What is the difference between attr_reader, attr_writer, and attr_accessor in Ruby?

Correct Answer: attr_reader defines only reader methods, attr_writer defines only writer methods, and attr_accessor defines both

Make the most of this question

This page focuses on one Ruby MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

Ruby MCQs MCQ: What is the difference between attr_reader, attr_writer, and attr_accessor in Ruby? | Extra Education