why constructor dont have returns type?

Answer Posted / venkatesh

Constructor donot return any data.it is mainly used for
initialization i.e one time activity like database
connectiviy, constructors are automatically invoked when
created objects created.

Is This Answer Correct ?    32 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is boolean flag in java?

568


What is diamond operator in java?

491


What is the purpose of object oriented programming?

528


What methods are used in Servlet?Applet communication?

1655


Which object oriented concept is achieved by using overloading and overriding?

544






Which containers use a flowlayout as their default layout in java programming?

501


Is there any difference between synchronized methods and synchronized statements?

569


What is final variable?

486


What are the high-level thread states in java programming?

575


What is the use of optional ?

559


Explain about member inner classes?

580


Explain the scope of a variable.

624


Why are lists ordered in java?

537


What is garbage collection? What is the process that is responsible for doing that in java?

643


How do you initialize an arraylist in java?

503