How is visibility of methods changed in ruby?
Answer / Sunny Rana
In Ruby, method visibility can be controlled using access modifiers such as public, private, and protected. By default, methods are public (visible to other objects). Private methods can only be called within the object they are defined, while protected methods can be called from the same object or its subclasses.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are Ruby arrays and how they can be created?
Explain ruby data types.
What is the scope of a local variable in ruby?
Explain case statement in Ruby?
Explain Ruby hashes?
Can you call a private method outside a ruby class using its object?
Can you please explain what is the difference between string and symbol?
How can you removed from array in ruby?
How is object methods defined in ruby?
Do you know what is the defined operator?
What is the difference between extend and include?
Tell me how symbol is different from variables?