Created
June 5, 2019 13:52
-
-
Save import-benjamin/fc7ad3732fe5864ca9e8f51afd66a86d to your computer and use it in GitHub Desktop.
Implicit class enhancement
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
package classes | |
object ImplicitClassSuperRichString { | |
implicit class SuperRichString(in:String) { | |
def world:String = in+", world" | |
} | |
def main(args: Array[String]): Unit = { | |
println("Hello" world) | |
println("Goodnight" world) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment