From: "Jesús Gabriel y Galán" Date: 2013-04-22T22:52:04+09:00 Subject: Re: BEGINNER -CLASS QUERY On Mon, Apr 22, 2013 at 3:45 PM, shaik farooq wrote: > HEY as we know that the object conatins the instance variables that are > defined in the class In statically typed languages, you have to declare the types of variables. Instance variables are one example, and are defined in the class typically. > but in ruby we are not defining any data member in the class but object > of that class contains the instance variables Ruby is dynamically typed, you don't declare variables or their types before hand. Assigning to a variable makes it exist. So for instance variables, they come to existence when a method is invoked that assigns to an instance variable. Example: class A def test @value = 3 end end a = A.new Now a, which is a local variable, exists, and it references an object that is an instance of class A. Inside this object, no instance variable exists yet. Now: a.test At this point, the instance variable @value has been created inside the object referenced by a. Hope this clears up your confusion a bit, Jesus.