As I was working with Java I was able to create generic lists with constraints, covariant, Contravariant etc..
List<? extends Chat> chats=new ArrayList<Siamois>(); ...
But know I have to work in Scala I used constraints for methods and for class for instance :
def addToList[T <: Chat](t:T):List[T]=List[T](t) but in fact is there a way to write these lines of java in Scala ?
List<? extends Chat> chats=new ArrayList<Siamois>(); List<? super Siamois> siamois2=new ArrayList<Chat>(); thanks