Examveda

What is the purpose of encapsulation in Ruby classes?

A. To hide the internal state of an object and restrict access to it

B. To expose the internal state of an object and allow unrestricted access to it

C. To define class methods

D. To define instance methods

Answer: Option A


Join The Discussion

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