Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
scala> def printAnimals[T <: Animal](animal: ArrayList[T]) = {
| for(i <- 0 to animal.size - 1) {
| println(animal.get(i))
| }}
printAnimals: [T <: Animal](animal: java.util.ArrayList[T])Unit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment