C++ Programming Questions Answers - Chapter 1
-
1. All members of class have which access to its members
- private
- public
- protected
- depends
Answer And Explanation
Answer: Option A
Explanation:
-
2. Which operator is used to define a member of a class from outside the class definition
- ->
- ::
- .
- >>
Answer And Explanation
Answer: Option B
Explanation:
-
3. Constructor is
- A class automatically called whenever a new object of this class is created
- A class automatically called whenever a new object of this class is destroyed
- A function automatically called whenever a new object of this class is created
- A function automatically called whenever a new object of this class is destroyed
Answer And Explanation
Answer: Option C
Explanation:
-
4. If no constructor is there, then compiler assumes the class to have a default constructor with no arguments
- True
- False
Answer And Explanation
Answer: Option A
Explanation:
-
5. How to define a destructor
- X~() {}
- X() {}~
- X() ~{}
- ~X() {}
Answer And Explanation
Answer: Option D
Explanation:
-
7. Every class has atleast one construtor
- True
- False
Answer And Explanation
Answer: Option A
Explanation: