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.
Answers were Sorted based on User's Feedback
Answer / anitha
a) 1 & 2
b)2 & 3
c)1, 2 & 3
d)None of the statements are true
| Is This Answer Correct ? | 131 Yes | 10 No |
Answer / 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 |
How can we share data between actions in qtp..pls tell me
i am shortlisted in corporation bank for the post of computer officer the next phase is group discussion. i want to know how to prepare and what about the topics for preparing thanking you if you have any suggestion please give me prabhatmishra21@rediffmail.com
0 Answers Corporation Bank, State Bank Of India SBI,
what is elligibility criteria of hcl?
what is dns?
what are the simlerities between macro and subroutine
Sketch a velocity time graph for a skydiver jumping out of a plane.
i have an interview in Qatar Petroleum. So please provide the all details abt safety management
what is a Additional domain ? what is a child domain?
Why we use 4 - 20 ma?
In how many ways can you put numbers 1 to 9 without repeating in a 3*3 matrix,So that the total of elements in any row and column and diagonal is 15?
How do trains go around bends?
why you are suitable to work here???? plzz give me the ans f this Q. i was told to write 200 words on the spot....
Civil Engineering (5086)
Mechanical Engineering (4456)
Electrical Engineering (16639)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)