why constructor dont have returns type?

Answer Posted / sankar r k

The function of the constructor is to assign values to the
instance variable when the object is created for the first
time.The name of the constructor and the class name will be
same.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is number data type?

526


How many bytes is double?

539


What is the difference between state-based unit testing and interaction-based unit testing?

489


What are the differences between heap and stack memory?

539


Will minecraft java be discontinued?

640






What is an example of a keyword?

534


What is a top level class in java?

521


Can you add null to a list java?

575


How to declare an arraylist in java?

476


What is lambda expression in java?

533


What is javac used for?

507


What is difference between arraylist and list in java?

572


What is the lifetime and scope of a variable?

509


What is the meaning of variables in research?

522


What is the final keyword denotes?

663