# Defining a subclass

**URL:** <https://discourse.julialang.org/t/defining-a-subclass/80716>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 8, 2022, 5:06pm UTC](https://discourse.julialang.org/t/defining-a-subclass/80716 "2022-05-08T17:06:41Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [May 9, 2022, 4:05pm UTC](https://discourse.julialang.org/t/defining-a-subclass/80716/16 "2022-05-09T16:05:54Z")

</div>

> [@Niall](#):
>
> The notation `Vector{<:Complex}` is new to me - I’m just not sure what it would bring me, since `Complex` doesn’t (can’t) have any subtypes. What am I missing?

Sorry, I didn’t use the correct words: `Complex` is not an abstract type, but it is a _parametric_ type. That means that it is not either a concrete type, as you can see when you create actual complex numbers:

```julia
julia> typeof(1+1im)
Complex{Int64}

julia> typeof(1.0 + 1.0im)
ComplexF64 (alias for Complex{Float64})

```

None of them is “just” `Complex`: the concrete types also carry information of the type of numbers contained (real and imaginary parts).

Now, about the notation `Vector{<:Complex}`, the first few posts of the following discussion can help you (the discussion is about the abstract type `Number`, not about the parametric type `Complex`, but the situation is analogous):

> [@Why \[1, 2, 3\] is not a Vector{Number}?](https://discourse.julialang.org/t/why-1-2-3-is-not-a-vector-number/52645):
>
> I don’t understand this: julia\> isa([1,2,3], Vector{Number}) false Each 1, 2, or 3 is certainly a Number: julia\> isa(1, Number) true It is illogical to say [1, 2, 3] is not Vector{Number} when each element is a Number.

---

_[View the full topic](https://discourse.julialang.org/t/defining-a-subclass/80716)._
