Which of the following statements are true about
constructors and methods?

1)A constructor has it's own name, a return type and is
invoked using the new operator.
2)A function has it's own name, a return type and is invoked
using the dot operator.
3)A constructor has the name of the class, no return type
and is invoked using the new operator.

Answer Posted / prince

2 & 3 are correct answers for sure.

because,
constructor is invoked at the time of creation of the object to a class, hence it is invoked using new operator, and the name of constructor and class must be same coz, the default constructor is invoked at the time of creation of object, and lastly, constructor has no return type and it can only returns constructor ( the concept of copy constructor)




if I am wrong are any modifications needed, please plz plz plz plz inform me

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can u give me the information about the questions asked by the bally in campus

1438


difference between java programming and c programming??

2391


hey..... anybody here from CG? i m from CG n have been selected in the written xam sbi(clerical).interview date is 5/5/2010. answer me if anybody is there 4m CG

1358


System Not Getting Shut down Through Software Auttomatically It Will Restart wat is the Problem?

1494


Explain the concept of segmentaion.

1697






What is the difference between while & do while loop

1627


Whet is KCFT and difference between CFM and KCFT

1422


How to work Air cooled and water cooled chiller?

1319


what is means of admistrative distance

1589


Friends Any one tell me the best institute for the telecom protocol course

1568


plz explain abt refrigeration r22 bitzer comprassors trouble shooting and maintenance

1356


what do you mean by CPU register?

1637


I have done BE ( computer science) i secleted in sbi clerical written exam. so what questions they asked according to my subject please send me the answer

1550


what are the steps u follow to create an custom idoc program in which environment u create the program?

1588


what are the reseach done by itc brfore launching e-copal

1448