OOPS Quiz (Set 12) OOPS (Set 12) 1 / 10 What is the difference between a single inheritance and a multiple inheritance? A single inheritance is a type of inheritance where an object can inherit from one class, while a multiple inheritance is a type of inheritance where an object can inherit from multiple interfaces A single inheritance is a type of inheritance where an object can only inherit from one class, while a multiple inheritance is a type of inheritance where an object can inherit from multiple classes A single inheritance is a type of inheritance where an object can inherit from one class, while a multiple inheritance is a type of inheritance where an object can inherit from multiple methods 2 / 10 What is the difference between a constructor and a method? A constructor is a method that is declared in a class, while a method is declared outside of a class A constructor is a method that is called when an object is created, while a method is a method that is called on an object A constructor is a method that is used to initialize the data members of an object, while a method is a method that is used to perform some operation on an object 3 / 10 What is the difference between a class variable and an instance variable in terms of scope? A class variable is accessible to all objects of the class, while an instance variable is only accessible to the object that it is declared in A class variable is accessible to all methods of the class, while an instance variable is only accessible to the methods that it is declared in A class variable is accessible to all classes, while an instance variable is only accessible to the class that it is declared in 4 / 10 What is the difference between a virtual method and an abstract method? A virtual method is a method that can be called from a base class, while an abstract method cannot be called from a base class A virtual method is a method that has a default implementation, while an abstract method does not have a default implementation A virtual method is a method that can be overridden by a subclass, while an abstract method must be overridden by a subclass 5 / 10 What are the benefits of using object-oriented programming? Object-oriented programming allows you to create reusable code Object-oriented programming allows you to create code that is easier to understand Object-oriented programming allows you to create code that is easier to maintain 6 / 10 What is the difference between an object-oriented programming language and a procedural programming language? An object-oriented programming language is a language that allows you to create data structures, while a procedural programming language is a language that allows you to create algorithms An object-oriented programming language is a language that allows you to create objects, while a procedural programming language is a language that allows you to create procedures An object-oriented programming language is a language that allows you to create both data structures and algorithms, while a procedural programming language is a language that only allows you to create algorithms 7 / 10 What is the difference between a local variable and a class variable? A local variable is a variable that is accessible to all methods in a class, while a class variable is a variable that is only accessible to the method it is declared in A local variable is a variable that is accessible to all objects in a class, while a class variable is a variable that is only accessible to the object that created it A local variable is a variable that is declared inside a method, while a class variable is a variable that is declared outside of any methods 8 / 10 What is the difference between a constructor and a destructor? A constructor is a method that is used to initialize the data members of an object, while a destructor is a method that is used to clean up the resources of an object A constructor is a method that is called when an object is created, while a destructor is a method that is called when an object is destroyed A constructor is a method that is called when an object is created, while a destructor is a method that is called when an object is modified 9 / 10 What is the difference between a static method and an instance method? A static method is a method that can be called without creating an object of the class, while an instance method is a method that can only be called by creating an object of the class A static method is a method that can be called by any object of the class, while an instance method is a method that can only be called by the object that created it A static method is a method that is stored in the class itself, while an instance method is a method that is stored in the object 10 / 10 What is the Composite pattern? The Composite pattern allows you to treat individual objects and compositions of objects as a tree The Composite pattern allows you to treat individual objects and compositions of objects in a uniform way The Composite pattern allows you to treat individual objects and compositions of objects as a graph Your score isThe average score is 0% 0% Restart quiz