Created
May 5, 2015 23:42
-
-
Save mgodave/a98f49f7cf9c940c0b41 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
class UpdateClass { | |
var _x = 1 | |
def update(x: Int) = { | |
_x = x | |
} | |
} | |
val u = new UpdateClass() | |
println(u._x) // prints 1 | |
u() = 2 | |
println(u._x) // prints 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment