Home / Programming MCQs / Ruby MCQs / Question
M
Q. What is the purpose of the attr_accessor method in Ruby classes?
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
What is the syntax to open file in ruby?
If expression. The expression can be of which type?
What will be the output of the given ruby code?
What will be the output of the given code?
Which method in Ruby is used to set the position of the file pointer?
What is the output of the given code? a=["hey", "ruby", "language"] b=[1, 2, 3] puts b[1] puts a[2]
In Ruby, which method is called automatically when an object is created?
What is the result of the expression `"hello".split` in Ruby?
Discusssion
Login to discuss.