Basic Syntax In Ruby - Study Mode

[#126] How do you call a method in Ruby?
Correct Answer

(B) object.method_name

[#127] What are the different types of comments in Ruby?
Correct Answer

(C) Single-line # and multi-line """ """

[#128] What is the difference between =~ and == operators?
Correct Answer

(A) =~ checks for string pattern matching, == checks for equality

[#129] What is the difference between nil and false?
Correct Answer

(A) nil represents absence of value, false represents a boolean value

[#130] What is the correct way to define a symbol in Ruby?
Correct Answer

(B) symbol = :value