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
how to configure cisco router & switches plz provide me path steps?
I am 2012 pass out b tech student(cse). i have recently started software manual testing class. Is this field is benefitial for me in future?
What do you mean by component versionig?
c ka base kya hota hai? what is communication?
what is the stucture of.net array?
what is the need for oobs
what is difference between class and object in c++
y the range of char is between -128 to 127 only????
what is static identifier in c language?
what is the different between view and materialized view in oracle DBA?
Given a number (N), program to check whether its binary form has periodic or not
in single linked list , each node contains data and address of next node. if middle of list the node is damaged/crashed then how to find where the link is failed and how to get the all the data which is stored after the crashed node?
95) func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d ! ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); please help me in detail ....with flowchart
Explain Belady's Anomaly.
is it possible to get u.s visa with 55% in b-tech and 15 backlogs