Vidyalelo
Ruby Programming · Q18

Methods in Ruby

Programming · Ruby Programming · question 18

Q18

Which of the following is NOT a valid method definition syntax in Ruby?

A.
def method_name; end
B.
define method_name; end
Answer
C.
define_method(:method_name) { }; end
D.
def self.method_name; end

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board