Computer Knowledge
Object-Oriented Programming
2,686 Questions
Object-oriented programming questions test core computer science concepts like classes, inheritance, polymorphism, and encapsulation. The focus includes Java program structures, method overloading, and memory allocation for objects. This topic is essential for technical sections in various recruitment tests.
Java class definitionsMethod overriding rulesPolymorphism conceptsGeneric type parametersMemory allocation in objects
Object-Oriented Programming Questions
What is the mechanism that allows a class to inherit the properties and methods of another class?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
B
Correct answer
Explanation
Inheritance is the mechanism that allows a class to inherit the properties and methods of another class.
What is the ability of an object to take on different forms?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
C
Correct answer
Explanation
Polymorphism is the ability of an object to take on different forms.
What is the process of hiding the implementation details of an object from the user?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
D
Correct answer
Explanation
Abstraction is the process of hiding the implementation details of an object from the user.
What is the process of creating a class from an existing class?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
B
Correct answer
Explanation
Inheritance is the process of creating a class from an existing class.
What is the ability of an object to respond to different messages in different ways?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
C
Correct answer
Explanation
Polymorphism is the ability of an object to respond to different messages in different ways.
What is the process of creating a class that is a specialized version of another class?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
B
Correct answer
Explanation
Inheritance is the process of creating a class that is a specialized version of another class.
What is the process of hiding the implementation details of an object from the user?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
D
Correct answer
Explanation
Abstraction is the process of hiding the implementation details of an object from the user.
What is the process of creating a class from an existing class?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
B
Correct answer
Explanation
Inheritance is the process of creating a class from an existing class.
What is the ability of an object to respond to different messages in different ways?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
C
Correct answer
Explanation
Polymorphism is the ability of an object to respond to different messages in different ways.
What is the process of creating a class that is a specialized version of another class?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
B
Correct answer
Explanation
Inheritance is the process of creating a class that is a specialized version of another class.
What is the process of hiding the implementation details of an object from the user?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
D
Correct answer
Explanation
Abstraction is the process of hiding the implementation details of an object from the user.
What is the process of creating a class from an existing class?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
B
Correct answer
Explanation
Inheritance is the process of creating a class from an existing class.
What is the ability of an object to respond to different messages in different ways?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
C
Correct answer
Explanation
Polymorphism is the ability of an object to respond to different messages in different ways.
What is the process of creating a class that is a specialized version of another class?
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Abstraction
B
Correct answer
Explanation
Inheritance is the process of creating a class that is a specialized version of another class.
How is IoU calculated for object detection with multiple classes?
-
IoU is calculated separately for each class.
-
IoU is calculated for all classes together.
-
IoU is not calculated for object detection with multiple classes.
A
Correct answer
Explanation
IoU is calculated separately for each class in object detection with multiple classes. This is because the IoU score for a particular class is only affected by the overlap between the predicted and ground truth bounding boxes for that class.