I wanted to add different objects to an ArrayBuffer collection, so I have to define a base class
case class base (a:String,b:String)
case class Super1 (a:String, b:String, c:String) extends base(a,b)
case class Super2 (a:String, b:String, c:String, d:String) extends base(a,b)
val array=New ArrayBuffer[base]()
val super1=new Super1("1","2","super1")
val super2=new Super2("1","2","super2","super2")
array+=(super1)
array+=(super2)
Actually, have not tested the above code but want to know if the adding object are Super1 or Super2 instead of the base class as I need the value of all parameters in the derived classes..