scala pattern matching make one case go to another code example
Example: scala pattern matching
list match{
case head::tail => print(head)
case _ => print("It is not list")
}
list match{
case head::tail => print(head)
case _ => print("It is not list")
}