Home
About Us
Contact Us
Bookmark
Saved Bookmarks
Current Affairs
General Knowledge
Chemical Engineering
UPSEE
BSNL
ISRO
BITSAT
Amazon
ORACLE
Verbal Ability
→
Web Development
→
Bootstrap in Web Development
→
Name the three levels of access control for Ruby m...
1.
Name the three levels of access control for Ruby methods
Answer»
In Ruby, methods may either be
PUBLIC
, protected, or private.
Public methods enforce
no
ACCESS
control
-- they can be called in any scope.
Protected methods are only accessible within their defining class and its subclasses.
Private methods can only be
ACCESSED
and viewed within their defining class . They are only accessible within the
context of the current
OBJECT
.
Show Answer
Discussion
No Comment Found
Post Comment
Related InterviewSolutions
Can you print the current day of the week in words such if the current day is Monday then it should print “Monday” in Ruby?
What is lambda ruby?
What does ‘self’ mean?
What is the difference between calling super and calling super()?
Write a single line of Ruby code that prints the Fibonacci sequence of any length as an array.
Write a function that sorts the keys in a hash by the length of the key as a string. For instance, the hasht :
What is the difference between nil and false in Ruby?
What is the use of load and require in Ruby ?
Explain Ruby object and how to create
What are the different ways to compare Ruby string
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies