The following code snippet has two methods, namely "method1" and "method2".
def method1
x = "This"
y = "is"
z = "test"
end
puts method1
def method2
x = "This"
y = "is"
z = "test"
return x, y, z
end
print method2
What will be the output of the method1 and method2 when called with puts and print?
Correct Answer:
Output of "print method2" will be "Thisistest"
Explanation:
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
More Ruby MCQ Questions