Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class p1 extends object
- field a
- field b
- method initialize(f, g)
- begin
- set a = f;
- set b = g;
- 0
- end
- method setValor(p,q)
- begin
- set a = +(a,p);
- set b = +(b,q);
- send self getValor(a,b)
- end
- method getValor(p,q)
- +(p, +(q,a))
- class p2 extends p1
- field d
- method initialize(k, l, m)
- begin
- super initialize(k,l);
- set d = m;
- 0
- end
- method getValor(m,n)
- +(d, +(m,n))
- let
- o1 = new p1(1,2)
- o2 = new p2(4,5,6)
- in
- let
- a = send o1 setValor(1,4)
- b = send o2 setValor(3,2)
- in
- +(a,b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement