Question
Which OOP concept ensures that the internal details of
an object are hidden from the outside world, providing a clear interface for interaction?Solution
Encapsulation is a cornerstone of OOP that enforces data hiding by restricting direct access to an object’s internal state. 1. Data Protection: By using access modifiers (e.g., private, protected), encapsulation shields sensitive data from external manipulation. 2. Clear Interfaces: Through getter and setter methods, encapsulation provides controlled interaction with an object’s data, ensuring integrity and security. 3. Modularity: Encapsulation helps developers manage code complexity by compartmentalizing data and behavior within distinct classes. Thus, encapsulation creates a robust framework for managing dependencies and ensuring secure object interactions. Why Other Options Are Incorrect: • A) Abstraction: Focuses on hiding implementation details but differs by emphasizing interface design. • B) Polymorphism: Deals with dynamic behavior and method variability, unrelated to data hiding. • D) Inheritance: Describes property/method sharing between classes, not encapsulation. • E) Composition: Involves constructing objects using other objects, unrelated to access control.
Article 129 of Constitution states that “The Supreme Court shall be a court of …………. and shall have all the powers of such a court including t...
When did the Arbitration and Conciliation (Amendment) Act, 2021 receive Parliamentary assent, replacing the Arbitration & Conciliation (Amendment) Ordin...
The right available to a tenant under the Chhattisgarh Rent Control Act 2011 is provided in:Â
A gratuitous bailor is duty bound to ____________
When did the Information Technology Act, 2000 came into force___________________
A Magistrate of the First class may, for the reasons to be recorded by him, stop the proceedings at any stage:
Abetment of suicide is punished with ________________________
Which of the following is not an exception to defamation?
According to the Information Technology Act, 2000 addressee means_______________
A preference shall be deemed to be given at a relevant time under the IBC if it is given to a related party, during the period of________________________