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++.
Questions
Polymorphism in C++ is a
- process to derive a class from Base class
- a way in which entity behaves in several forms
- process to hide complexity of a program
- none of the above
A static variable is
- a variable, the value of which keeps on changing through out the program
- a variable, the value of which increase in a uniform order
- a variable, the value of which decreases constantly
- a variable, the value of which remains constant through out the program
A language in order to be called as an object-oriented programming language should essentially consist of
- functions
- variables
- classes
- overloading
C++ is a
- Object Based Language
- Structured Programming Language
- Procedural Language
- Object Oriented Language
Memory leak is a phenomenon of
- dynamically allocated memory which is easily reachable
- memory that remains leaking even after allocation
- dynamically allocated memory which is not reachable
- memory that remains leaking even after deallocation
Why is abstraction important in object-oriented programming?
- For data hiding
- For declaring classes
- For memory management
- For binding the data with functions
Which of the following is the main function of inheritance using classes?
- It adds graphics to the computer.
- It binds data and functions.
- It helps to secure the data.
- It leads to the code reusability.
Which of the following is absent in C and later is introduced in C++ for the purpose of memory management?
- Functions
- Classes
- Pointers
- Structures
Which of the following is not an object-oriented programming language?
- Pascal
- C++
- C#
- Java
Which of the following is/are the main feature(s) of an object?
- run time entity
- instance of a class
- combination of data and functions
- all of the above
Polymorphism refers to
- hiding of data
- binding of data with its methods
- using the features of one class in other classes
- using a function in different ways
Directions: Fill in the blank with the appropriate option.
The binding of the data and ________ is known as encapsulation.
- objects
- functions
- classes
- operators
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?
- Only 1
- Only 1 and 3
- Only 1 and 2
- 1, 2 and 3
How does an object-oriented programming help in the security of data?
- Using the concept of inheritance
- Using the concept of structures and unions
- Using the concept of encapsulation
- Using the concept of abstraction