Methods In Ruby - Study Mode

[#16] What does the private keyword do in Ruby?
Correct Answer

(B) Restricts access to methods below it

[#17] Which of the following is true about optional parameters in Ruby methods?
Correct Answer

(B) They have default values assigned

[#18] In Ruby, which method is used to check if an object responds to a certain method?
Correct Answer

(B) respond_to?

[#19] What does the `super` keyword do in Ruby?
Correct Answer

(A) Calls the method with the same name in the superclass

[#20] What is the purpose of the `alias` keyword in Ruby?
Correct Answer

(A) To create an alias for a method