Y
Q. What will be output for the following code?
begin raise 'Exception Created!' puts 'After Exception' rescue puts 'Finally Saved!' retry end
Be careful while using retry statement because it may result into infinite loop.
You must be Logged in to update hint/solution
Q. Reserved word can not be used as?
Q. What is the output of the given code? for num in 1..3 puts num for i in 1..2 puts num*i end end
Q. Which of the following is the correct way to define a range in Ruby?
Q. What is the purpose of the rescue keyword in Ruby?
Q. Which of the following is a good practice for writing clear and readable Ruby code?
Q. What is the purpose of the attr_accessor method in Ruby classes?
Q. What does the keys method return when called on a hash in Ruby?
Discusssion
Login to discuss.