Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Scope-modifiers/Wren/scope-modifiers.wren
Normal file
10
Task/Scope-modifiers/Wren/scope-modifiers.wren
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class MyClass {
|
||||
construct new(a) {
|
||||
_a = a // creates an instance field _a automatically
|
||||
}
|
||||
a { _a } // allow public access to the field
|
||||
}
|
||||
|
||||
var mc = MyClass.new(3)
|
||||
System.print(mc.a) // fine
|
||||
System.print(mc._a) // can't access _a directly as its private to the class
|
||||
Loading…
Add table
Add a link
Reference in a new issue