Ruby - Class Methods and Variables
What is the output of this Ruby code?
class String
def shout
self.upcase + "!"
end
end
puts "hello".shoutclass String
def shout
self.upcase + "!"
end
end
puts "hello".shoutshout method returns the string in uppercase plus an exclamation mark."hello".shout returns "HELLO!".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions