Question
Which of the following best illustrates Encapsulation
in Object-Oriented Programming?Solution
Encapsulation is a key OOP principle that involves combining data (fields) and methods (functions) into a single unit (class) and controlling access to them using access modifiers like private, protected, and public. For instance, a BankAccount class might hide its balance field (using private access) and expose methods like deposit() and withdraw() to manipulate it. Encapsulation ensures data integrity and security , preventing unauthorized access or modifications. Why Other Options Are Incorrect : 2. Allowing multiple objects to interact through message passing : This describes Message Passing , which focuses on communication between objects. 3. Hiding complex implementation details from the user : This is Abstraction , not Encapsulation. 4. Enabling a class to inherit properties and methods from another class : This refers to Inheritance , unrelated to Encapsulation. 5. Defining a one-to-many relationship between objects : This aligns with Aggregation or Composition , not Encapsulation.
Facts under the Acts may be______.
Maximum paid up capital in case of public company
Pending investigation or inquiry, the Board may attach the bank accounts of any person associated in violation of any provisions of the Act for a maximu...
In the case of Supreme Court Advocates on-Record Association and another Vs Union of India which of the following amendment to the constitutio...
Marshalling is ____________.
In which of the following cases, notice of dishonour is unnecessary?
 I.    when it is dispensed by the party
 II.    ...
Instruments of gift of immovable property is a document for which, as per Section 17 of the Registration Act, 1908, ___________________________.
Which Section of the Indian Contract Act, 1872, specifically deals with revocation of proposals and acceptances?Â
Donald was a passenger from Bikaner to Palitana in a Jai jinendra Plane. When the plane landed at the airport at Palitana on 28th September, 2020 it was...
What are the maximum number of members to represent the interests of employees’ associations, subscribers, commerce and industry, intermediaries, and ...