Creates a array with the Array class's new method: array2 = Array.new
array = ["Hello", "there", "AAA", 1, 2, 3]
puts array[0]
puts array[1]
puts array.length
array2 = Array.new
puts array2.length
array2[0] = "Banana"
array2[1] = "fish"
puts array2[0] + " " + array2[1]
puts array2.length
Related examples in the same category