OOP Principles

Covers the fundamental principles of object-oriented programming including polymorphism, abstraction, encapsulation, and inheritance. Tests understanding of OOP concepts, classes, objects, and their applications in languages like C++.

14 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Polymorphism in C++ is a

  1. process to derive a class from Base class
  2. a way in which entity behaves in several forms
  3. process to hide complexity of a program
  4. none of the above
Question 2 Multiple Choice (Single Answer)

A static variable is

  1. a variable, the value of which keeps on changing through out the program
  2. a variable, the value of which increase in a uniform order
  3. a variable, the value of which decreases constantly
  4. a variable, the value of which remains constant through out the program
Question 3 Multiple Choice (Single Answer)

A language in order to be called as an object-oriented programming language should essentially consist of

  1. functions
  2. variables
  3. classes
  4. overloading
Question 4 Multiple Choice (Single Answer)

C++ is a

  1. Object Based Language
  2. Structured Programming Language
  3. Procedural Language
  4. Object Oriented Language
Question 5 Multiple Choice (Single Answer)

Memory leak is a phenomenon of

  1. dynamically allocated memory which is easily reachable
  2. memory that remains leaking even after allocation
  3. dynamically allocated memory which is not reachable
  4. memory that remains leaking even after deallocation
Question 6 Multiple Choice (Single Answer)

Why is abstraction important in object-oriented programming?

  1. For data hiding
  2. For declaring classes
  3. For memory management
  4. For binding the data with functions
Question 7 Multiple Choice (Single Answer)

Which of the following is the main function of inheritance using classes?

  1. It adds graphics to the computer.
  2. It binds data and functions.
  3. It helps to secure the data.
  4. It leads to the code reusability.
Question 8 Multiple Choice (Single Answer)

Which of the following is absent in C and later is introduced in C++ for the purpose of memory management?

  1. Functions
  2. Classes
  3. Pointers
  4. Structures
Question 9 Multiple Choice (Single Answer)

Which of the following is not an object-oriented programming language?

  1. Pascal
  2. C++
  3. C#
  4. Java
Question 10 Multiple Choice (Single Answer)

Which of the following is/are the main feature(s) of an object?

  1. run time entity
  2. instance of a class
  3. combination of data and functions
  4. all of the above
Question 11 Multiple Choice (Single Answer)

Polymorphism refers to

  1. hiding of data
  2. binding of data with its methods
  3. using the features of one class in other classes
  4. using a function in different ways
Question 12 Multiple Choice (Single Answer)

Directions: Fill in the blank with the appropriate option.

The binding of the data and ________ is known as encapsulation.

  1. objects
  2. functions
  3. classes
  4. operators
Question 13 Multiple Choice (Single Answer)

Consider the given statements.
(1) OOP provides security to data using access specifiers.
(2) OOP introduces the concept of classes for memory management.
(3) OOP uses pointers to direct to a specified location.

Which of the given statements is/are the major advantage(s) of an object-oriented programming language?

  1. Only 1
  2. Only 1 and 3
  3. Only 1 and 2
  4. 1, 2 and 3
Question 14 Multiple Choice (Single Answer)

How does an object-oriented programming help in the security of data?

  1. Using the concept of inheritance
  2. Using the concept of structures and unions
  3. Using the concept of encapsulation
  4. Using the concept of abstraction