What are the three levels of method access control for classes and what do they signify? What do they imply about the method?
Answer / Abhishek Kumar Rai
In Ruby, there are three levels of method access control for classes: public, protected, and private. nn- Public methods (denoted with no modifier) can be called from anywhere, even outside the class.n- Protected methods (prefixed with a single 'at' symbol '@') can only be called within the class and its subclasses.n- Private methods (prefixed with two 'at' symbols '@@') can only be called from within the defining class itself.
| Is This Answer Correct ? | 0 Yes | 0 No |
How will you rename and delete a file in Ruby?
How do the following methods differ: @my_string.strip and @my_string.strip! ?
What things we can define in the model?
How to access Ruby strings elements in an application?
What are blocks and procs?
Explain module mixins in Ruby?
Tell us in ruby, it explains about the defined operator?
Do you know how ruby looks up a method to invoke?
Explain when self.up and self.down method is used?
Explain about the defined operator in ruby?
How is object methods defined in ruby?
Tell me how symbol is different from variables?