Created
March 28, 2016 08:01
-
-
Save mosser/19c63397081553a0cb30 to your computer and use it in GitHub Desktop.
Object field initialization
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
trait Foo { def bar: String } | |
object PouetApp extends Foo with App { | |
override val bar = "geek" | |
} | |
PouetApp.bar | |
object Pouet extends Foo { | |
override val bar = "geek" | |
} | |
Pouet.bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Execution in a Scala Worksheet: