OOP Senior
What do you understand by Garbage Collection in the OOP world?
Select the correct answer
Garbage Collection is the process of organizing data within a database
Garbage Collection is the process of encapsulating data
Garbage Collection is the process of automatically reclaiming memory that is no longer in use by the program
Garbage Collection is a method of inheritance in OOP
What is the "diamond problem," and how is it resolved?
Select the correct answer
The 'diamond problem' is a type of polymorphism; it is resolved using encapsulation
The 'diamond problem' happens when a class has multiple destructors; it is resolved using destructor chaining
The 'diamond problem' occurs when a class has multiple constructors; it is resolved using constructor overloading
The 'diamond problem' occurs when a class inherits from two classes that have a common base class; it is resolved using virtual inheritance
What is hybrid inheritance?
Select the correct answer
Hybrid inheritance is a method of encapsulation
Hybrid inheritance is the process of defining multiple methods in a class
Hybrid inheritance is a special type of polymorphism
Hybrid inheritance is a combination of two or more types of inheritance
What is hierarchical inheritance?
Select the correct answer
Hierarchical inheritance is a type of polymorphism
Hierarchical inheritance is when a class inherits from multiple base classes
Hierarchical inheritance is a method of overloading functions
Hierarchical inheritance is when multiple classes inherit from a single base class
Differentiate between an abstract class and an interface?
Select the correct answer
An interface is a type of abstract class
An interface can contain concrete methods; an abstract class cannot
An abstract class can be instantiated; an interface cannot
An abstract class can have abstract and concrete methods; an interface can only have abstract methods
Can you create an instance of an abstract class?
Select the correct answer
No, you cannot create an instance of an abstract class
Yes, you can create an instance of an abstract class
Only if the abstract class contains no abstract methods
Only if the abstract class is instantiated within a subclass
What is an abstract class?
Select the correct answer
An abstract class is a method used to create objects
An abstract class is a class that contains only abstract methods
An abstract class is a class that cannot be instantiated and may contain abstract methods
An abstract class is a type of polymorphism in OOP
How is encapsulation different from data abstraction?
Select the correct answer
Encapsulation is a method of overloading; abstraction is a method of overriding
Encapsulation is the bundling of data; abstraction is the hiding of implementation details
Encapsulation is a type of inheritance; abstraction is a type of polymorphism
Encapsulation is the process of defining multiple methods; abstraction is the process of creating objects