Last active
December 20, 2015 21:09
-
-
Save lu911/6195789 to your computer and use it in GitHub Desktop.
Iterable method test
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
object Main { | |
def main(args: Array[String]): Unit = { | |
new IteratorMethods() | |
} | |
} | |
class IteratorMethods(){ | |
private val iterable = Iterable(1,2,3,4,5) | |
val methods = List(method) | |
def method() | |
{ | |
println("head : " + iterable.head) | |
println("head_option : " + iterable.headOption) | |
println("last : " + iterable.last) | |
println("last_option : " + iterable.lastOption) | |
println("init : " + iterable.init) | |
println("inits : " + iterable.inits) | |
println("tail : " + iterable.tail) | |
println("tails : " + iterable.tails) | |
println("size : " + iterable.size) | |
println("isEmpty : " + iterable.isEmpty) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment