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 |
Explain the difference between a single quote and double quote?
Explain the three levels of access control for ruby methods?
Explain the concepts and capabilities of garbage collection feature of Ruby?
Explain how Symbol is different from variables?
Explain ruby ranges. What are the ways to define ranges?
Mention what is the command to create a migration?
What is the scope of a local variable in ruby?
Explain about the command line options?
Is ruby whitespace-dependent?
Name different methods for io console in ruby?
Write the command to get installed Ruby version in your system?
How symbol is different from variables?