Podcast
Questions and Answers
What is a special characteristic of Constructors?
What is a special characteristic of Constructors?
- They have a return type like void
- They cannot have default arguments
- They can be inherited by derived classes
- They get automatically invoked when the objects are created (correct)
Can Constructors have default arguments?
Can Constructors have default arguments?
- They can have default return types
- Yes, like other functions (correct)
- No, they cannot have default arguments
- They can have default access specifiers
Where should Constructors be declared?
Where should Constructors be declared?
- In the public section (correct)
- In the protected section
- In the private section
- In the main function
What is the return type of Constructors?
What is the return type of Constructors?
When are Constructors automatically invoked?
When are Constructors automatically invoked?
Can Constructors be inherited?
Can Constructors be inherited?
Flashcards are hidden until you start studying