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 |
i need the placement paper of ford IT service...
what is domain functional level in windows server 2003?
what are differences b/w EIA 449 and EIA 530?
what are the artifacts in coding phase in SDLC????
HELLO ALL OF U.I HAVE QUALIFIED IN SBI CLERICAL WRITTEN EXAMINATION AND MY INTERVIEW IS ON 20TH OF THIS MONTH.IAM SOTWARE BACKGROUNDED CANIDIATE SO CAN ANY ANYBODY WHOSE INTERVIEW IS OVER CAN TELL ME THAT WHAT QUESTIONS THEY ASKED RELATING TO COMPUTER SCIENCE.
Explain diffrent parts of an instruction format.
How do you reset or reseed the IDENTITY column?
Give the coding for system reboot in C
how to reuse an outdated laptop?
what is b tree
What's the range of C/A?
What is histogram? why and how it is used?