Skip to content

Instantly share code, notes, and snippets.

@rbobillot
Last active August 29, 2015 14:19
Show Gist options
  • Save rbobillot/bd740149a48a32bcffee to your computer and use it in GitHub Desktop.
Save rbobillot/bd740149a48a32bcffee to your computer and use it in GitHub Desktop.
EncoreLaPuissance.scala
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