Question: Listing 1 def palindrome?selfself.reverse end # example call: refer.palndrome ? #=> true 5. (3 pts) Which of the following statements is TRUE regarding Listing 1,

Listing 1 def palindrome?selfself.reverse end # example call: "refer".palndrome ? #=> true 5. (3 pts) Which of the following statements is TRUE regarding Listing 1, checking if a string reads the same backwards as forwards? A. You could add this method to the String class by reopening String and defining palindrome? s a class B. C. The method will work correctly when added to any class that provides a class method reverse. method there. You could add this as a class method in the String class by putting it in a module, reopening String, and using include to "mix" that module into String. D. The method will work correctly when mixed into any class whose instances respond to reverse by returning a reversed version of themselves. The method will work correctly if the class includes the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
