What does instantiation mean? (The concept of instantiation)

Please help me here,
I have a hard time understanding the
concept of instantiation. If an object
is instantiated, what does it mean?
Thanks.

By the way,
what is the difference between initializing an
object and instantiating an object? public class A
     private int a;
     A(int x) //constructor with one argument
          a = x;
     public int getV()
          return a;
Each class will have a constructor
that will be invoked while instantiating an object.
(If a constructor is not provided explictly
the compiler will provide a default constructor
that takes no arguments and initialize the data
members with their default values.)
The constructor is a special function that initialize
the data members of an object.
In the above example
A obj1 = new A(10);
will create memory for the object obj1 and then
the constructor invoked will initialize the data member
a to the value 10.
>
Does the instance variables and objest mean the
same? Are they the same thing? No.
Instance variable is different from an object.
The variable 'a' is said to be an instance variable of the
class A.
The object obj1 is an instance of the class A.

Similar Messages

Maybe you are looking for