No one mentioned that case classes are also instances of Product
and thus inherit these methods:
def productElement(n: Int): Any
def productArity: Int
def productIterator: Iterator[Any]
where the productArity
returns the number of class parameters, productElement(i)
returns the ith parameter, and productIterator
allows iterating through them.