How do I print a List of anything in Scala?

Viewed 54495

At the moment I have a method that prints Ints

def printList(args: List[Int]): Unit = {
  args.foreach(println)
}

How do I modify this so it is flexible enough to print a list of anything?

5 Answers
Related