In Scala, you can make your type parameters limited to type bindings. Here in the first method, you make your type parameter, creating an upper bound with a subclass of Container.
Using the 1st method, you cannot pass a parameter in the Container class, which is not a subclass of your Container class.
In your second example, you can pass an instance of the parameter type of any class. So, here you are not restricting anything, while in the first example you are restricting the type of a subtype of the Container class.
source share