W
Wu Ning
My ruby version is 1.8.6
a = Array.new(3,Array.new())
a[2]<<1
puts a
the result of a is
[[1], [1], [1]]
in irb..
I don't understand why.
I just wannt insert into a 1 into the third array of a.
a = Array.new(3,Array.new())
a[2]<<1
puts a
the result of a is
[[1], [1], [1]]
in irb..
I don't understand why.
I just wannt insert into a 1 into the third array of a.