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 generic class?

649


What is function overriding and overloading in java?

583


What are the major advantages of internal iteration over external iteration?

575


Why we use methods in java?

541


What is the range of a character variable?

545






Is 0 an irrational number?

604


What is the constructor?

583


Differentiate between stringbuffer and string?

598


What is type parameter in java?

522


Write a program to find the whether a number is an Armstrong number or not?

574


Explain about automatic type conversion in java?

572


Why string is not thread safe?

543


Write a program to reverse a number in java?

564


What is a numeric format?

570


Explain the selection sort algorithm?

644