OOPS Quiz (Set 5) OOPS (Set 5) 1 / 10 What is the primary advantage of using inheritance in OOP? Enables method overloading Promotes code reusability and the creation of more specialized classes Allows for multiple instances of a class Allows for multiple inheritance 2 / 10 What is the concept of method overloading in OOP? Creating a new subclass with the same methods as the parent class Defining methods in a subclass that are not present in the parent class Creating multiple instances of a class Defining multiple methods with the same name but different parameters in a class 3 / 10 What is the difference between an instance variable and a class variable? An instance variable is defined in the class scope, while a class variable is defined in the object scope An instance variable is unique to each instance of a class, while a class variable is shared among all instances An instance variable is shared among all instances of a class, while a class variable is unique to each instance There is no difference between the two 4 / 10 In OOP, what is a constructor? A method that defines the behavior of an object A method used for method overloading A special method used to initialize objects when they are created A method used to create instances of classes 5 / 10 What is the purpose of the 'this' keyword in object-oriented programming? To create a new instance of a class To access methods of another class To refer to the current instance of a class To define a constructor for a class 6 / 10 What is abstraction in object-oriented programming? Creating instances of classes Hiding complex implementation details and showing only the necessary features of an object A technique for combining data and methods Inheriting attributes from a parent class 7 / 10 What does the term 'overloading' mean in OOP? Creating multiple constructors for a class Defining multiple methods with the same name Creating multiple instances of a class Defining a new subclass 8 / 10 What is the purpose of an interface in OOP? To define a blueprint for a class and its methods To define a new data type To provide a way to access private members To define a contract for classes that implement it 9 / 10 What does the term 'constructor' refer to in OOP? A method that is used for type casting A method that is used to access private members A method that is used to create instances of a class A method that is used to override a superclass method 10 / 10 What is method overriding in OOP? Creating a new method with the same name in a subclass Creating a new class with the same name Calling a method from another method Defining multiple constructors Your score isThe average score is 0% 0% Restart quiz