Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Classes/Oz/classes.oz
Normal file
24
Task/Classes/Oz/classes.oz
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
declare
|
||||
class Something
|
||||
feat
|
||||
name %% immutable, public attribute (called a "feature")
|
||||
attr
|
||||
count %% mutable, private attribute
|
||||
|
||||
%% public method which is used as an initializer
|
||||
meth init(N)
|
||||
self.name = N
|
||||
count := 0
|
||||
end
|
||||
|
||||
%% public method
|
||||
meth increase
|
||||
count := @count + 1
|
||||
end
|
||||
end
|
||||
in
|
||||
%% create an instance
|
||||
Object = {New Something init("object")}
|
||||
|
||||
%% call a method
|
||||
{Object increase}
|
||||
Loading…
Add table
Add a link
Reference in a new issue