Content deleted Content added
m →Object-oriented programming: Format |
m →Object-oriented programming: Format |
||
Line 148:
<pre>
new point { # Create new object then access it using braces
x=10 y=20 z=30 # Set the object attributes
print() # Call the print() method
} # end of object access using braces
class point # Define the class
x y z # Define the attributes (x,y,z)
func print # Define the print() method
? x + nl + y + nl + z # Print the attributes values (nl means printing a new line)
</pre>
|