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
What will be the sql query to list the employee names those are getting 3rd highest salary ?
how to cable size by Amp with example
as we know that java is a platform independent language, but we need jvm for the same operating system why?
what is difference between semaphre and deadlock
what is program data insulation in dbms?
4. What is your typical way of dealing with conflict?
compair and contrast procedrual and object oriented programming language
operation of carrier aided protection and what is the basis for choice of frequncy in powerline carrier system
What type of questions are asked in interview?
please tell me difference between router and cisco router
Problem:Design and implement a class that allows a teacher to track the grades in a single ourse.Include methods that calculate the average grae, the highest grade, and the lowest grade.Wrute a program to testyour class implementation in a c#. given grades:integral=85, physics=87, datastruct=84.
can any one give 10 ways to create a file in unix...???? through command prompt....
pls send me rrb se(s&t)questions
what is locative information on web.........?
What is the key element of Defect Report and Test case format?