What is meant by constructor?

Answer Posted / suman blazta

Constructors are used to create and initialize objects of their class type.
Constructor is a special member function that takes the same name as the class name.The constructor is automatically named when an object is created. A constructor is named whenever an object is defined or dynamically allocated using the "new" operator.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the abstract class?

765


What is the difference between path and classpath variables?

712


How java uses the string and stringbuffer classes?

731


Describe different states of a thread.

766


When can an object reference be cast to an interface reference in java programming?

764


Is singleton set an interval?

707


What is the use of static methods?

782


Can java program run without jre?

765


How do you create a sop?

728


Which is better arraylist or vector?

775


What is qms certification?

713


Why string objects are immutable in java?

796


What is a local block?

879


How do you compare objects in java?

690


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

797