# Initialize array of arrays

**URL:** <https://discourse.julialang.org/t/initialize-array-of-arrays/11610>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [June 12, 2018, 2:44pm UTC](https://discourse.julialang.org/t/initialize-array-of-arrays/11610 "2018-06-12T14:44:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![favba](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/favba/32/2735_2.png) [@favba](https://discourse.julialang.org/u/favba)\
**Post date:** [June 12, 2018, 3:44pm UTC](https://discourse.julialang.org/t/initialize-array-of-arrays/11610/4 "2018-06-12T15:44:55Z")

</div>

Note, as said above, that `fill` will initialize the array of arrays with the **same** array:

```julia
julia> a = fill(Int[],2,2)
2×2 Array{Array{Int64,1},2}:
 Int64[] Int64[]
 Int64[] Int64[]

julia> push!(a[1,1],1)
1-element Array{Int64,1}:
 1

julia> a
2×2 Array{Array{Int64,1},2}:
 [1] [1]
 [1] [1]

```

---

_[View the full topic](https://discourse.julialang.org/t/initialize-array-of-arrays/11610)._
