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
can u give me the information about the questions asked by the bally in campus
difference between java programming and c programming??
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
System Not Getting Shut down Through Software Auttomatically It Will Restart wat is the Problem?
Explain the concept of segmentaion.
What is the difference between while & do while loop
Whet is KCFT and difference between CFM and KCFT
How to work Air cooled and water cooled chiller?
what is means of admistrative distance
Friends Any one tell me the best institute for the telecom protocol course
plz explain abt refrigeration r22 bitzer comprassors trouble shooting and maintenance
what do you mean by CPU register?
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
what are the steps u follow to create an custom idoc program in which environment u create the program?
what are the reseach done by itc brfore launching e-copal