Home / Programming MCQs / Ruby MCQs / Question
Y
Q. In Ruby, Array index -1 represent ______.
A negative index is assumed relative to the end of the array --- that is, an index of -1 indicates the last element of the array, -2 is the next to last element in the array, and so on.
You must be Logged in to update hint/solution
Which method is used to check if a string contains a specific substring in Ruby?
What is the purpose of inheritance in Ruby?
Which of the following Ruby Pseudo Variables is used to return the name of the current source file?
Which operator is used for exponentiation in Ruby?
What is the purpose of abstraction in OOP?
What does the term "lazy evaluation" refer to in Ruby?
The .length method is used to check number of characters.
What is the output of the given code? i = 0 while i < 5 puts i i=(i+1)**2 end
Discusssion
Login to discuss.