11. What does the super keyword do in a Ruby class? A. Calls the same method in the superclass B. Calls the same method in the subclass C. Returns the superclass D. Initializes a superclass object Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
12. Which of the following is a correct way to define a class method in Ruby? A. def self.method_name B. def class.method_name C. class def method_name D. def method_name.self Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
13. What is the purpose of the include keyword in Ruby classes? A. To mix in methods from a module into a class B. To define a new method C. To create a new instance D. To inherit from another class Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
14. In Ruby, what does the extend keyword do? A. Adds methods from a module as class methods B. Adds methods from a module as instance methods C. Initializes a new instance D. Calls a superclass method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
15. What does the self keyword refer to in Ruby classes? A. The current instance of the class B. The superclass of the class C. The class itself D. The class constructor Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
16. What is the purpose of the attr_reader method in Ruby classes? A. To define getter methods for class attributes B. To define setter methods for class attributes C. To define both getter and setter methods for class attributes D. To define private methods for class attributes Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
17. Which keyword is used to access methods and variables within the same class in Ruby? A. this B. self C. object D. instance Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
18. What is the purpose of the attr_writer method in Ruby classes? A. To define setter methods for class attributes B. To define getter methods for class attributes C. To define both getter and setter methods for class attributes D. To define private methods for class attributes Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
19. In Ruby, what is a superclass? A. The class from which a class inherits B. The class that inherits from another class C. The class that contains all other classes D. The class that has no superclass Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
20. Which keyword is used to define an instance method in Ruby? A. method B. self C. def D. class Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board