From: Jay Pangmi Date: 2008-09-11T23:08:11+09:00 Subject: Re: define and call methods in ruby maybe I'm wrong. but what I'm saying is (Here's what I do in java) public class myclass { ..... String name; static int i=0; //defining a instance method public void setName(String name) { this.name=name; } //defining the method. public void printMessage() { System.out.println("Message"); } //for some event public void actionPerformed(ActionEvent e) { if (e.getSource()==xxxx) { printMessage(); //declaring a method in the same class. } } ........ } public class anotherclass extends myclass { myclass mc; int j; .............. mc.setName("James"); //calls method with the instance of the class j=myclass.i; //here coz i belongs to class. } Hope, it clears out what I'm trying to do. Just example, not very good in java either... So, what I'm trying to do is declare similar method as printMessage() in ruby. thanks -- Posted via http://www.ruby-forum.com/.