Home / Programming MCQs / Ruby MCQs / Question
V
Q. What will be the output of the given code?
boolean_var = 15 < 16 && 15 < 15 puts boolean_var
15<16 is true but 15<15 is false hence the overall expression will evaluate to false.
You must be Logged in to update hint/solution
Q. What does the --remote flag do in the context of the gem list command in Ruby?
Q. The .upcase and .capitalize method are used for capitalizing the whole string.
Q. What does the \w character class represent in a regular expression in Ruby?
Q. Which metacharacter is used to specify the beginning of a line in a regular expression in Ruby?
Q. What is the method used to check if a variable is empty in Ruby?
Q. What is the purpose of the chown method in Ruby file I/O?
Q. What is the output of the expression: 7 / 2 in Ruby?
Q. What does the advance method do for a Date object in Ruby?
Q. What happens if a block is passed to a method that doesn't expect one in Ruby?
Discusssion
Login to discuss.