Last active
August 29, 2015 14:19
-
-
Save rbobillot/bd740149a48a32bcffee to your computer and use it in GitHub Desktop.
EncoreLaPuissance.scala
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 Puissance(init:Int) | |
{ | |
private var _maVariable = init | |
def maVariable = _maVariable | |
def maVariable_= (n:Int) { | |
_maVariable = n | |
} | |
} | |
val p = new Puissance(4) | |
println( p.maVariable ) | |
p.maVariable = 42 | |
println( p.maVariable ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment