Results for: constructor

What is a copy constructor?

A copy constructor is a type of constructor which constructs the object of the class from another object of the same class. The copy constructor accepts a reference to its own class as a parameter. A valid copy constructor can… Full Answer

Why constructor in java?

What are the importance of constructor in java?Constructor is automatically called immediately after the object is created , before the new operator complete . Constructor is important because they have no return type , not even void. Full Answer