Examveda

What does the `protected` keyword do in Ruby classes?

A. Makes methods accessible only within the class and its subclasses

B. Makes methods accessible only within the class

C. Makes methods accessible only from outside the class

D. Makes methods accessible from anywhere in the code

Answer: Option A


Join The Discussion

Related Questions on Object Oriented Programming (OOP) Concepts in Ruby