Vidyalelo
Ruby Programming · Q12

Object Oriented Programming (OOP) Concepts in Ruby

Programming · Ruby Programming · question 12

Q12

Which of the following is a correct way to define a class method in Ruby?

A.
def self.method_name
Answer
B.
def class.method_name
C.
class def method_name
D.
def method_name.self

Answer: Option A

Solution

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