Created
April 25, 2018 16:18
-
-
Save kmizu/c40437f11c65b0a1fe8357c98dfe3ed3 to your computer and use it in GitHub Desktop.
Overloading by arity of methods
This file contains hidden or 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 O { | |
def f: Int = 0 | |
def f(x: Int): Int = x | |
def main(args: Array[String]): Unit = { | |
println(f) | |
println(f(3)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment