# Array vs DenseArray?

**URL:** <https://discourse.julialang.org/t/array-vs-densearray/95538>\
**Category:** New to Julia\
**Created:** [March 4, 2023, 12:10pm UTC](https://discourse.julialang.org/t/array-vs-densearray/95538 "2023-03-04T12:10:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DOT](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DOT](https://discourse.julialang.org/u/DOT)\
**Post date:** [March 4, 2023, 12:10pm UTC](https://discourse.julialang.org/t/array-vs-densearray/95538/1 "2023-03-04T12:10:38Z")

</div>

Hi there!

_What’s the difference between_ `DenseArray` _and_ `Array`_?_

It looks to me as if there were two different types (i.e., not one an alias of the other?), with no difference in the internal representation… 🤔  
Why are both needed?

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [March 4, 2023, 12:27pm UTC](https://discourse.julialang.org/t/array-vs-densearray/95538/2 "2023-03-04T12:27:15Z")

</div>

I have never used `DenseArray` myself but it looks like it’s a part of the type hierarchy and should be useful for dispatch.

```julia
julia> supertype(Array)
DenseArray

julia> subtypes(DenseArray)
6-element Vector{Any}:
 Array
 Base.CodeUnits
 Base.Experimental.Const
 Random.UnsafeView
 SharedArrays.SharedArray
 SuiteSparse.CHOLMOD.Dense

```

---

<div class="post-metadata">

**Author:** ![DOT](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DOT](https://discourse.julialang.org/u/DOT)\
**Post date:** [March 4, 2023, 1:43pm UTC](https://discourse.julialang.org/t/array-vs-densearray/95538/3 "2023-03-04T13:43:43Z")

</div>

Ah, ok! I didn’t realize it was an abstract type! 👍
