Polymorphism: Difference between revisions

Content added Content deleted
No edit summary
Line 1,490: Line 1,490:
Point p = Point(20, 20)
Point p = Point(20, 20)
Point c = Circle(10, 10, 5)
Point c = Circle(10, 10, 5)
Circle c1 = c
p.print()
p.print()
c.print()
c.print()
watch(p)
watch(p)
watch(c)
watch(c)
watch(c1)
</syntaxhighlight>
</syntaxhighlight>
{{out}}
{{out}}
Line 1,509: Line 1,511:
Point: <§(0x02bf8098)>
Point: <§(0x02bf8098)>
Point, Circle: <§(0x00bb8560)>
Point, Circle: <§(0x00bb8560)>
Circle: <§(0x00bb8560)>
</pre>
</pre>