I am learning scala and tried following form Scala Cookbook:
trait Animal
trait FurryAnimal extends Animal
case class Dog(name:String) extends Animal
case class Cat(name:String) extends Animal
Now when I did following as :
val x = Array(Dog("Fido"),Cat("Felix"))
it show result as :
x:Array[Product with Serializable with Animal] = Array(Dog(Fido),Cat(Felix))
Although I know that a case class is mixed in with Product trait
What I am not getting is : Product with Serializable with Animal
As per my understanding Product has something to do with Pattern matching
I did google it but didn't get anything.Please Help to get me the concept in detail.
Thanks