Last updated
Last updated
Here, “<: Animal
” is an upper bound of the type parameter A
.
It means that A
can be instantiated only to types that conform to Animal
.
Generally, the notation
A <: B
means: A is a subtype of B, and(upper bound)
A >: B
means: A is a supertype of B, or B is a subtype of A.(lowerbound)