Skip to content

Instantly share code, notes, and snippets.

@shivangi1015
Created May 3, 2018 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shivangi1015/36385a1c6d61536fb86fc9e01ea86da9 to your computer and use it in GitHub Desktop.
Save shivangi1015/36385a1c6d61536fb86fc9e01ea86da9 to your computer and use it in GitHub Desktop.
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