12/14/2008

Constructor

The constructor initializes the object.
The process written in the constructor is done when initializing its class.

class Sample {
    /* Constructor */
    Sample() { }
}

Default constructor
A default constructor doesn't take any argument.
If you don't write any constructor, the compiler creates a default constructor.
If you write a constructor that has an argument(s), the compiler doesn't create a default constructor.