Home / Programming MCQs / Ruby MCQs / Question

Y

Yami Thakur • 9.05K Points
Tutor III

Q. Which of the following is correct syntax to create an array in ruby?

(A) names = Array.new
(B) names = Array.new(20)
(C) Both A and B
(D) None of the above
Explanation by: Yami Thakur
We can create an array using both option A and option B.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.