Object-Oriented Programming: MCQ questions with answers
CS Fundamentals (Placement), Unit 4. 60 Object-Oriented Programming questions with explanations (CS Fundamentals (Placement)). Topics: Object-Oriented Programming. Take a free test now.
Topics
- Object-Oriented Programming: abstract, constructor, methods, design pattern, multiple inheritance, achieved, destructor, member
Key terms: abstract, constructor, methods, design pattern, multiple inheritance, achieved
Sample questions with answers
Most restrictive access specifier:
Options: A) public B) protected C) private D) default
Answer: C) private. Private members are accessible only within the class.
In C++, a destructor is written with which prefix?
Options: A) # B) ~ C) ! D) &
Answer: B) ~. Example: ~Car().
Constructors can be:
Options: A) Overloaded B) Inherited as-is C) Static D) Virtual in Java
Answer: A) Overloaded. Different parameter lists.