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


Please Help Members By Posting Answers For Below Questions

What will be the sql query to list the employee names those are getting 3rd highest salary ?

1290


how to cable size by Amp with example

2173


as we know that java is a platform independent language, but we need jvm for the same operating system why?

1364


what is difference between semaphre and deadlock

1680


what is program data insulation in dbms?

1912






4. What is your typical way of dealing with conflict?

1425


compair and contrast procedrual and object oriented programming language

1315


operation of carrier aided protection and what is the basis for choice of frequncy in powerline carrier system

5935


What type of questions are asked in interview?

1258


please tell me difference between router and cisco router

1654


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.

1524


can any one give 10 ways to create a file in unix...???? through command prompt....

2002


pls send me rrb se(s&t)questions

1652


what is locative information on web.........?

1382


What is the key element of Defect Report and Test case format?

1179