Created
September 3, 2015 06:59
-
-
Save zakki/0c8ab72f9295923d8073 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
//http://codemonkeyism.com/how-to-improve-programming-with-interfaces/ | |
case class Person(n:String) { def name():String = n } | |
type Nameable = { def name():String } | |
def printName(n:Nameable) { println(n.name) } | |
printName(new Person("Codemonkey")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment