Object Oriented Programming - class, object, encapsulation, inheritance, polymorphism, abstract classes - Question Bank
1. The concept of 'object-oriented programming' was first popularized by which company?
2. What is the fundamental difference between an abstract class and an interface in many OOP languages?
3. In OOP, inheritance allows a class to reuse code from another class. This promotes:
4. What is the primary goal of abstraction in software design?
5. Which OOP principle allows a single interface to represent multiple underlying forms?
6. What does the term 'object state' refer to in OOP?
7. An abstract class can contain:
8. What is a key advantage of polymorphism?
9. Which of the following best describes the concept of a 'class'?
10. If a class `Shape` has a method `draw()`, and `Circle`, `Square`, `Triangle` classes inherit from `Shape` and override `draw()`, calling `draw()` on a `Shape` reference pointing to a `Circle` object will execute:
11. What is the primary purpose of data hiding in encapsulation?
12. A class that contains only abstract methods and no concrete methods or instance variables is often called an:
13. What is a common way to achieve abstraction in OOP?
14. Which OOP concept is most related to the idea of 'is-a' relationship?
15. What is a constructor in the context of a class?
16. Polymorphism allows you to treat objects of different classes in a uniform way if they share a common:
17. A method signature includes the method name and its:
18. Encapsulation helps in making code more:
19. What is the main purpose of using abstract classes?
20. Consider a `Dog` class and a `Cat` class, both inheriting from an `Animal` class. This is an example of:
21. What happens when you create an object from a class?
22. Which of the following is NOT a core principle of OOP?
23. What is the term for a method defined in an abstract class that has no implementation?
24. A class that cannot be instantiated and is designed to be inherited from is typically:
25. Which OOP concept promotes code reuse by allowing classes to share common functionality?
26. What are the actions or functions that an object can perform called?
27. In OOP, what are the characteristics or properties of an object called?
28. If a class `A` inherits from class `B`, and class `B` inherits from class `C`, this is an example of:
29. What does it mean for a class to be 'instantiable'?
30. Which OOP principle helps in reducing complexity by modeling real-world entities?
31. What is the relationship between a class and an object?
32. If a class has multiple methods with the same name but different parameter lists, this is an example of:
33. Consider a `Car` class inheriting from a `Vehicle` class. The `startEngine()` method is defined in `Vehicle` and overridden in `Car`. This is an example of:
34. What keyword is typically used to define an abstract class in many OOP languages?
35. An abstract method is a method that:
36. Which type of polymorphism allows a derived class to provide a specific implementation of a method that is already defined in its base class?
37. Which type of polymorphism allows a method to have the same name but different parameters in the same class?
38. What is the primary benefit of encapsulation?
39. A class that inherits from another class is called a:
40. A class from which other classes inherit is called a:
41. Which OOP concept focuses on showing only essential features and hiding unnecessary details?
42. What is an abstract class in OOP?
43. The ability of a function or method to perform different actions based on the object it is acting upon is called:
44. What OOP principle allows objects of different classes to respond to the same method call in their own specific ways?
45. The process of an object taking on the properties of another object is known as:
46. In OOP, what concept allows a new class to derive properties and behaviors from an existing class?
47. What is the term for the mechanism that restricts direct access to some of an object's components, often referred to as 'data hiding'?
48. Which OOP principle involves bundling data (attributes) and methods (functions) that operate on the data within a single unit?
49. What is an instance of a class called in OOP?
50. In Object-Oriented Programming (OOP), what is a blueprint or a template for creating objects called?