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.
Which of the following shortcut keys is used to make the contents of a cell underlined in MS Excel 365?
What is the use of SUM formula in Excel?
............. is the functional key to display save-as box.
DNS in internet technology stands for
What does DMA stand for?
Jatin’s laptop has an LCD screen. The acronym LCD stands for:
This type of software contains rows and columns.
What is the use of a Pivot Table in Excel?
Which of the following contains information about a single ‘entity’ in the database like a person, place, event or thing?
The code that relational database management systems use to perform their database task is referred to as