OOP Fundamentals: 15 MCQs with answers

All 15 multiple-choice questions from this kit, free and with no sign-up.

Warm-up · 8 questions

Q1. What is the primary characteristic of Object-Oriented Programming (OOP)?

Beginner
A Data and methods are combined into objects.
B Functions are more emphasized.
C Data and functions are separated.
D It uses only procedural constructs.
Show the answer

A · Data and methods are combined into objects.

OOP is based on objects that combine data and methods, unlike procedural programming where they are separate.

Q2. Which of the following is NOT one of the six pillars of OOP?

Beginner
A Inheritance
B Compilation
C Class
D Object
Show the answer

B · Compilation

Compilation is not a pillar of OOP. The six pillars are Class, Object, Encapsulation, Abstraction, Inheritance, and Polymorphism.

Q3. In OOP, a class is best described as:

Beginner
A A blueprint for creating objects.
B A variable that holds data.
C An instance of an object.
D A method that performs actions.
Show the answer

A · A blueprint for creating objects.

A class is a blueprint that defines the attributes and behaviors of objects, but it does not hold data directly.

Q4. Which concept allows hiding internal implementation details and showing only essential features?

Beginner
A Encapsulation
B Polymorphism
C Inheritance
D Abstraction
Show the answer

D · Abstraction

Abstraction focuses on what an object does rather than how it does it, hiding complex details.

Q5. Inheritance in OOP promotes which of the following?

Beginner
A Multiple forms
B Code reusability
C Method overloading
D Data hiding
Show the answer

B · Code reusability

Inheritance allows a child class to acquire properties and methods from a parent class, promoting code reusability.

Q6. Polymorphism means:

Beginner
A No form
B One form
C Two forms
D Many forms
Show the answer

D · Many forms

Polymorphism literally means 'many forms' and allows objects to behave differently based on their type.

Q7. What is an object in OOP?

Beginner
A A function that performs actions.
B A variable that holds data.
C An instance of a class.
D A blueprint of a class.
Show the answer

C · An instance of a class.

An object is an instance of a class, created from the class blueprint, and holds its own data.

Q8. Polymorphism allows the same method to behave differently based on the object.

Beginner
A True
B False
Show the answer

A · True

Polymorphism enables methods to have different implementations depending on the object calling them.

Building up · 7 questions

Q9. What is encapsulation primarily used for?

Intermediate
A To bundle data and methods, restricting direct access.
B To create multiple forms of a method.
C To define a blueprint for objects.
D To allow a class to inherit from another.
Show the answer

A · To bundle data and methods, restricting direct access.

Encapsulation bundles data and methods into a single unit and restricts direct access using access modifiers.

Q10. Which of the following is an advantage of encapsulation?

Intermediate
A It enables method overloading.
B It provides data security.
C It allows multiple inheritance.
D It reduces code reusability.
Show the answer

B · It provides data security.

Encapsulation enhances security by hiding internal state and allowing access only through methods.

Q11. Which type of inheritance is NOT mentioned in the source content?

Intermediate
A Multilevel
B Parallel
C Multiple
D Single
Show the answer

B · Parallel

The source lists single, multiple, multilevel, hierarchical, and hybrid inheritance, but not parallel.

Q12. Which mechanism is used to achieve polymorphism?

Intermediate
A Method overloading and method overriding
B Class and object
C Inheritance and encapsulation
D Encapsulation and abstraction
Show the answer

A · Method overloading and method overriding

Polymorphism can be achieved through method overloading (compile-time) and method overriding (runtime).

Q13. Which of the following is an advantage of OOP?

Intermediate
A Weaker security
B Increased complexity
C Modular design
D Less code reusability
Show the answer

C · Modular design

OOP promotes modular design, making development and maintenance easier.

Q14. The relationship between a parent class and a child class is an example of:

Intermediate
A Polymorphism
B Encapsulation
C Abstraction
D Inheritance
Show the answer

D · Inheritance

Inheritance establishes an 'is-a' relationship where a child class inherits from a parent class.

Q15. Encapsulation and abstraction are the same concept in OOP.

Intermediate
A True
B False
Show the answer

B · False

Encapsulation is about bundling data and methods and restricting access, while abstraction is about hiding complex details and showing only essential features.

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Exam prep

Get Veda free See what students get

Free to start · No ads · Works in 42 languages