set the size of an array (the number of elements in an array) : Array Creation « Array « Ruby
- Ruby
- Array
- Array Creation
set the size of an array (the number of elements in an array)
months = Array.new(12)
# or like this:
months = Array.new 12
Related examples in the same category