OOPS Quiz (Set 6) OOPS (Set 6) 1 / 10 What is the difference between an abstract class and a concrete class? An abstract class is a class that has no methods, while a concrete class has methods An abstract class is a class that can be instantiated, while a concrete class cannot be instantiated An abstract class is a class that cannot be instantiated, while a concrete class can be instantiated 2 / 10 What is the difference between a public method and a private method? A public method can be accessed from within the class, while a private method can only be accessed from anywhere A public method is a function, while a private method is a subroutine A public method can be accessed from anywhere, while a private method can only be accessed from within the class 3 / 10 What is the difference between a method and a function? A method is a function that is defined within a module, while a function is a standalone piece of code A method is a function that is defined within a class, while a function is a standalone piece of code A method is a function that is defined within a program, while a function is a standalone piece of code 4 / 10 What is the difference between a class and an object? A class is a blueprint for creating objects, while an object is an instance of a class A class is a blueprint for creating functions, while an object is an instance of a function A class is a blueprint for creating variables, while an object is an instance of a variable 5 / 10 What is inheritance? Inheritance is the ability of an object to have multiple data members Inheritance is the ability of an object to have multiple methods Inheritance is the ability of an object to inherit the properties and methods of another object 6 / 10 What is polymorphism? Polymorphism is the ability of an object to have multiple methods Polymorphism is the ability of an object to have multiple data members Polymorphism is the ability of an object to take on different forms 7 / 10 In OOP, what is the purpose of a 'getter' method? To set the value of an instance variable To retrieve the value of an instance variable To define a new method in a class To access private methods of a class 8 / 10 What does the term 'polymorphism' mean in OOP? A technique for combining data and methods The ability of objects of different classes to be treated as objects of the same class The ability to present the same interface for different data types Creating objects from classes 9 / 10 What is the role of a destructor in OOP? To release the resources held by an object before it is destroyed To create a new instance of a class To define a method in a class To access private members of a class 10 / 10 What is the purpose of the 'new' keyword in OOP? To define a new class To create a new instance of a class To call a method from another class To access a class variable Your score isThe average score is 0% 0% Restart quiz