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 are multiple inheritances? Is it supported by java?

471


what is encapsulation in java? Explain

667


Which class is used by server applications to obtain a port and listen for client requests?

497


Explain some best practices you would apply while using collection in java?

573


What does exp mean in math?

537






Can you declare a private method as static?

703


Why java is said to be pass-by-value ?

553


What is basic syntax?

553


How to create a base64 decoder in java8?

561


List the different types of classloaders in java.

505


How does the java compiler work?

532


What is difference between jdk,jre and jvm?

575


How use .contains in java?

626


Is java a prime method?

555


Describe string intern() methodology

599