Home
Categories
Technology
Health
Education
Business
Lifestyle
News
Food & Reicipe
Entertainment
Travels and Tourism
Notes
Mock Test
Tools
Submit Study Materials
Pricing
About
Contact
Register
Login
Unit 5: Object-Oriented Programming (OOP) (10 Hours)
1. What does OOP stand for?
Object-Oriented Program
Object-Oriented Programming
Object-Oriented Protocol
Object-Oriented Process
2. Which of the following is not a core concept of OOP?
Inheritance
Encapsulation
Compilation
Polymorphism
3. What is the process of hiding the implementation details called?
Abstraction
Encapsulation
Inheritance
Polymorphism
4. Which of the following allows a class to inherit properties from another class?
Inheritance
Encapsulation
Polymorphism
Abstraction
5. What is a class?
A blueprint for creating objects
A type of object
An instance of an object
None of the above
6. What is an object?
An instance of a class
A blueprint for creating classes
A type of variable
A function
7. Which keyword is used to define a class in most OOP languages?
class
define
struct
object
8. What is the primary purpose of a constructor?
To create an object
To destroy an object
To initialize an object
To copy an object
9. What is polymorphism?
Ability to take multiple forms
A process of combining data
A method of inheritance
None of the above
10. Which of the following is true about encapsulation?
It hides data
It allows data access
It combines data
None of the above
11. What does inheritance provide in OOP?
Reusability
Abstraction
Complexity
All of the above
12. Which of the following is an example of a built-in data type?
Class
Object
Integer
Method
13. What is a destructor?
A function called when an object is created
A function called when an object is destroyed
A function that creates objects
None of the above
14. What is method overloading?
Having multiple methods with the same name but different parameters
Changing the implementation of a method
None of the above
All of the above
15. What is method overriding?
Changing a method's name
Redefining a method in a derived class
Combining methods
None of the above
16. Which of the following is an example of an access modifier?
Public
Class
Method
Function
17. What is the purpose of the super keyword?
To call the parent class constructor
To create a new object
To delete an object
None of the above
18. Which of the following statements about interfaces is true?
An interface can contain method implementations
An interface can be instantiated
An interface can extend multiple interfaces
None of the above
19. What is the relationship between a class and an object?
An object is a blueprint of a class
A class is a blueprint for creating objects
They are the same
None of the above
20. What do you call a class that cannot be instantiated?
Abstract class
Concrete class
Interface
None of the above
21. Which of the following is not an OOP language?
C++
Java
Python
C
22. In OOP, what is a subclass?
A class that is derived from another class
A class that has no base class
A class with multiple methods
None of the above
23. What does the this keyword refer to in a class?
The current object
The parent class
The current class
None of the above
24. Which of the following is not a benefit of OOP?
Code reusability
Improved productivity
Increased performance
Complexity
25. In which of the following scenarios would you use polymorphism?
When you need a single interface for multiple implementations
When creating a new object
When hiding data
None of the above
26. What is a key feature of OOP?
Global variables
Functions
Classes and objects
None of the above
27. What is the purpose of the final keyword in OOP?
To declare a constant
To prevent method overriding
To define an abstract class
None of the above
28. Which of the following terms refers to the act of combining data and functions?
Encapsulation
Abstraction
Inheritance
Polymorphism
29. What is a primary benefit of using abstract classes?
They cannot be instantiated
They allow multiple inheritance
They define concrete methods
None of the above
30. What is the difference between a class and a structure in OOP?
A class can have methods, but a structure cannot
A structure is a reference type while a class is a value type
A class is private by default, while a structure is public
None of the above
31. In OOP, what does the term "data hiding" refer to?
Protecting data from unauthorized access
Keeping data secret
Hiding functions
None of the above
32. What is a class method?
A method that can be called without creating an object
A method that can be called on an object
A method with no parameters
None of the above
33. Which of the following is true regarding constructors?
They have a return type
They cannot be overloaded
They are called automatically
They must be public
34. What is the output of the following code snippet if the class is named Example? Example obj;
An error
A new object named obj
A new class named Example
None of the above
35. What does the private access modifier do?
Restricts access to the class only
Allows access from anywhere
Allows access only to subclasses
None of the above
36. Which of the following is a characteristic of a base class?
It can be instantiated
It cannot have subclasses
It can have derived classes
None of the above
37. In OOP, what is encapsulation?
The combination of data and methods into a single unit
The process of inheritance
A way to define abstract classes
None of the above
38. Which keyword is used to inherit a class in most OOP languages?
inherits
extends
implements
None of the above
39. What is a concrete class?
A class that cannot be instantiated
A class that can be instantiated
A class with only abstract methods
None of the above
40. Which of the following statements is true about interfaces?
An interface can contain state
An interface can have methods with implementations
An interface can extend other interfaces
All of the above
41. What is the purpose of the static keyword in OOP?
To create class-level variables
To create instance-level variables
To define constants
None of the above
42. What do you call a function that is defined inside a class?
Method
Constructor
Variable
None of the above
43. What is the output of the following code? cout << typeid(int).name();
int
Integer
Error
None of the above
44. What is the term for creating multiple functions with the same name but different parameters?
Function Overloading
Function Overriding
Function Hiding
None of the above
45. What does it mean if a class is derived from more than one base class?
Multiple inheritance
Single inheritance
Abstract class
None of the above
46. What is a namespace in OOP?
A way to group related classes
A method of inheritance
A type of variable
None of the above
47. What is the primary goal of OOP?
To make programming easier
To improve performance
To simplify syntax
None of the above
48. What is a key characteristic of an abstract class?
It cannot be instantiated
It can have concrete methods
It can be derived from another class
None of the above
49. What is the purpose of using const in a method declaration?
To declare a constant
To prevent modification of parameters
To define a static method
None of the above
50. What happens if a class does not define a constructor?
A default constructor is provided
An error occurs
The class cannot be used
None of the above
51. What is the purpose of the protected access modifier?
To allow access from anywhere
To allow access only to derived classes
To restrict access to the class only
None of the above
52. What do you call the data members of a class?
Properties
Variables
Attributes
All of the above
53. What is the role of a virtual keyword in OOP?
To define a constant
To allow method overriding
To create an abstract class
None of the above
54. What is a class that cannot be instantiated called?
Abstract class
Concrete class
Interface
None of the above
55. In which situation would you use a base class?
When creating a specific object
When implementing an interface
When defining a general type
None of the above
56. What is the purpose of the override keyword?
To indicate a method is being overridden
To create an abstract method
To define a constructor
None of the above
57. What is a key advantage of using OOP?
Complexity
Reusability
Increased learning curve
None of the above
58. What is the default access modifier for class members in C++?
Public
Private
Protected
None of the above
59. Which of the following can be used to create an object of a class?
Constructor
Destructor
Member function
None of the above
60. What is inheritance in OOP?
Creating new classes from existing ones
Combining classes
Hiding data
None of the above
61. Which of the following is true about a derived class?
It cannot have a constructor
It inherits properties from a base class
It can only be abstract
None of the above
62. What is a key feature of encapsulation?
Grouping related data and methods
Combining different data types
None of the above
All of the above
63. In OOP, what does public mean?
Accessible from any code
Accessible only within the class
Accessible only by subclasses
None of the above
64. Which of the following best describes a method?
A function defined inside a class
A variable defined in a class
A blueprint for an object
None of the above
65. What is the output of a method that does not return a value?
nan
0
void
None of the above
66. What is a key feature of object-oriented languages?
Use of variables
Use of functions
Use of classes and objects
None of the above
67. In OOP, which of the following refers to a set of attributes and methods?
Class
Object
Function
None of the above
68. Which of the following represents the relationship of "is-a"?
Inheritance
Aggregation
Composition
None of the above
69. What is the primary function of an interface?
To provide a blueprint for classes
To implement methods
To define variables
None of the above
70. What is the term for the ability to call the same method on different objects?
Polymorphism
Inheritance
Encapsulation
None of the above
71. Which of the following is an example of data abstraction?
Hiding complex reality
Hiding function implementations
None of the above
All of the above
72. What does the term "method signature" refer to?
The method name and parameters
The method body
The return type
None of the above
73. In OOP, which of the following is true about classes?
Classes can contain data and methods
Classes can only contain data
Classes can only contain methods
None of the above
74. What is the relationship between a base class and a derived class?
Inheritance
Composition
Association
None of the above
75. What is an example of an encapsulation in programming?
A class that contains both data and methods
A function that hides variables
A constant variable
None of the above
76. Which of the following is true about a function in a class?
It can access the class's private data
It cannot access the class's private data
It cannot return a value
None of the above
Check Score
Results