OOPS Quiz (Set 16) OOPS (Set 16) 1 / 10 What is method overloading in Java? Defining multiple methods with the same name but different parameters in a class Defining a new method in a subclass Defining a method with the same name in a subclass Defining methods in an abstract class 2 / 10 What is a package in Java? A folder on the computer A collection of classes and interfaces grouped together A type of class A variable that holds multiple values 3 / 10 What is the difference between a class and an object in OOP? A class is a blueprint for creating objects, while an object is an instance of a class A class and an object are the same thing An object is a blueprint for creating classes, while a class is an instance of an object A class and an object are both blueprints for creating other classes 4 / 10 What is method hiding in Java? Defining a static method in a subclass with the same name as a static method in the parent class Defining a method in a subclass with the same name but different parameters as a method in the parent class Creating multiple instances of a class Defining a new method in a subclass 5 / 10 What is the purpose of the 'interface' keyword in Java? To define a new class To define a blueprint for a class and its methods To define a contract for classes that implement it To define a variable in a class 6 / 10 What is the 'super' keyword in Java used for? To create an instance of a class To access static methods To access methods from another class To call the constructor of the parent class 7 / 10 What is the purpose of the 'extends' keyword in Java? To create a new instance of a class To indicate that a class is implementing an interface To indicate that a class is inheriting from another class To indicate that a class is abstract 8 / 10 What is an anonymous class in Java? A class with no methods A class without a name that's defined inside another class or method A class that cannot have any instance variables A class that cannot be inherited 9 / 10 What is a template class in C++? A class that can be used to create instances of other classes A class that uses a template to define one or more types A class that inherits from multiple parent classes A class that has only static methods 10 / 10 What is the 'const' keyword in C++ used for? To declare classes To declare constant variables To declare static methods To declare virtual methods Your score isThe average score is 0% 0% Restart quiz