GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Thursday, December 23, 2010

Class In Jython

Here's a code on how to define a class in Jython:

>>> class Hello:
...    def __init__(self,name="no name"):
...        self.name = name
...    def greeting(self):
...        print "Hello, ",self.name
...
>>> luna = Hello("Luna Maya")
>>> luna.greeting()
Hello, Luna Maya
Share/Bookmark

No comments:

Post a Comment