# Difference between SArray{...} and StaticArray{...}

**URL:** <https://discourse.julialang.org/t/difference-between-sarray-and-staticarray/65528>\
**Category:** New to Julia\
**Tags:** staticarrays\
**Created:** [July 29, 2021, 9:54pm UTC](https://discourse.julialang.org/t/difference-between-sarray-and-staticarray/65528 "2021-07-29T21:54:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jinml](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jinml](https://discourse.julialang.org/u/jinml)\
**Post date:** [July 29, 2021, 9:54pm UTC](https://discourse.julialang.org/t/difference-between-sarray-and-staticarray/65528/1 "2021-07-29T21:54:31Z")

</div>

I am confused about the type parameters of `StaticArrays`. In particular, I defined `Point2F = Point{2,Float64}` for a 2D point , where the latter is from `GeometryBasics`. Its supertypes are as follows  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/b/9bfe700732c318cca87130b8f7f8a74a2f554784.png)  
I then defined `Vector2F=SVector{2,Float64}` to describe a 2-element vector. Its supertypes are  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/e/6e8152fde0ec0b4e1cfa4d3db630c677317813b4.png)  
I noticed `Point2F` to be a subtype of `StaticArray{Tuple{2},Float64,1}`, which I understand as a "`1`"D array with first dimension size “`2`”, and element type `Float64`. However, it is NOT a subtype of essentially the same thing, namely, `SArray{Tuple{2},Float64,1,2}`, which refers to a "`1`"D array with first dimension size “`2`”, eltype `Float64`, and total length “`2`”.  
My question is, why are the two types `SArray{...}` and ` StaticArray{...}` described above different? In what sense is the latter more general than the former? What types belong to the latter but not the former?

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [July 31, 2021, 12:12pm UTC](https://discourse.julialang.org/t/difference-between-sarray-and-staticarray/65528/2 "2021-07-31T12:12:06Z")

</div>

`Point2F` is an alias for `Point{2,Float64}`.

`Vector2F` is an alias for `SArray{Tuple{2},Float64,1,2}`.

These are two concrete types. Both are subtypes of the abstract type `StaticArray{Tuple{2},Float64,1}`.

Does this answer your question?

---

<div class="post-metadata">

**Author:** ![tchr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tchr/32/15138_2.png) [@tchr](https://discourse.julialang.org/u/tchr)\
**Post date:** [July 31, 2021, 1:44pm UTC](https://discourse.julialang.org/t/difference-between-sarray-and-staticarray/65528/3 "2021-07-31T13:44:20Z")

</div>

To elaborate on sudete’s answer: `StaticArray` is an abstract type while `SArray` is a concrete type. You cannot subtype concrete types, only abstract types. I.e. all concrete types in the type hierarchy are “final”.
