Constructors - Functions ,Properties

Q.  Which of the followings are true about constructors?

1. A class can have more than one constructor.
2. They can be inherited.
3. Their address can be referred.
4. Constructors cannot be declared in protected section of the class.
5. Constructors cannot return values.

- Published on 17 Jul 15

a. Only 1,2,4
b. 1,2,4,5
c. 1,3,5
d. 1,4,5

ANSWER: 1,4,5
 

    Discussion

  • Nihal   -Posted on 08 Oct 15
    The constructor have following properties.
    • A class can have more than one constructor.
    • Constructors cannot be declared in protected section of the class.
    • Constructors cannot return values.
    • Automatically called when object is created.
    • They should be declared in the public section
    • They make implicit calls to new and delete.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)