Question
Which of the following best describes Abstraction in
Object-Oriented Programming (OOP)?Solution
Abstraction is a core concept of OOP that focuses on hiding unnecessary implementation details while exposing only the essential features of an object. This is achieved through abstract classes and interfaces. For instance, a Car class might expose methods like start() or drive() without detailing how the engine works internally. Abstraction simplifies the development process by allowing programmers to focus on high-level logic rather than low-level complexities. It also enhances security by preventing direct access to sensitive parts of an application. Why Other Options Are Incorrect : 2. Restricting access to certain parts of an object to protect data : This describes Encapsulation , not Abstraction. Encapsulation involves bundling data and methods together and using access modifiers to control visibility. 3. Combining different objects into a single unit to represent a relationship : This describes Aggregation , where objects are linked to represent "has-a" relationships, like a Library having Books. 4. Allowing multiple classes to share the same method name but with different implementations : This defines Polymorphism , specifically method overriding or overloading, and is unrelated to abstraction. 5. Establishing a parent-child relationship between classes : This is Inheritance , where one class derives from another, enabling code reuse and hierarchy building.
Deletion in Red-Black Trees maintains balance using:
Which of the following scenarios violates Boyce-Codd Normal Form (BCNF) in a relational schema?
Which of the following attacks can occur when a user is tricked into performing unintended actions on a trusted website without their knowledge?
Given the following code snippet, which operation is performed on the binary tree to produce the output: 4, 2, 5, 1, 3 ?
class Node {Â Â Â Â Â in...Which of the following is a key advantage of digital signatures?
- Natural Language Processing (NLP)
In the context of sentiment analysis, which of the following NLP techniques provides the most accurate classification ...
What is the purpose of the keys() method in a dictionary?
In asymmetric encryption, which of the following statements is correct?
What is the primary purpose of a B+ Tree in a database management system?
Which of the following best differentiates between server-based virtualization and hypervisor-based virtualization?