Created
May 3, 2018 06:14
-
-
Save shivangi1015/36385a1c6d61536fb86fc9e01ea86da9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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