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 tree in java?

606


Can we clone singleton object in java?

721


Why we use set in java?

670


What do heavy weight components mean in java programming?

644


What is mnemonic in assembly language?

710






Tell us something about set interface.

694


What is the most important feature of java? What is an interface?

640


What are data types in oop?

701


What loop means?

673


What is the difference between an array and an array list?

632


What is getkey () in java?

704


Why is stringbuffer thread safe?

706


Is upper case in java?

668


Can an unreferenced object be referenced again?

874


How do you add spaces in java?

639