Continue with your mobile number
Encapsulation is a fundamental principle of OOP that involves bundling data (attributes) and methods (functions) that operate on the data into a single unit or class. It also restricts direct access to some components of the object, typically by declaring them private or protected. Access is then controlled through public methods known as getters and setters. Encapsulation ensures security and prevents unauthorized or accidental modification of data. For instance, in a class BankAccount , the balance attribute might be private, and only specific methods like deposit() or withdraw() are accessible to modify it. This safeguards the integrity of the data and prevents incorrect usage. Why Other Options Are Wrong Option A : "Polymorphism" Polymorphism deals with methods behaving differently for different object types, not with restricting access. Option C : "Inheritance" Inheritance allows a child class to use the properties and methods of a parent class but does not involve controlling access to data. Option D : "Abstraction" Abstraction hides complexity by exposing only essential features. However, encapsulation is specifically about access control at the data and method level. Option E : "Message Passing" Message passing refers to the communication between objects in OOP but does not control access to internal object components.
If step IV of a given input be ‘To ensure fair selection process in the government’, what is the seventh step of the input?
Input: two apparently met common friends planned in.
How many steps will be required to complete arrangement?
Which word/number is third to the right of eighth element from right end in step-III?
If the entry code for Batch C on 6th May, 2017 was “this morning noticed that one of the plants on”, then what was the entry code for ...
Given the input, what would be the step IV of the input?
Input: “this is the first study from where any”
Given the following input ‘This disease is not common in the world, what would be the VIth step?
If in certain way ‘unjust’ is related to ‘flower’ in step-II and ‘broccoli’ is related to ‘42’ in step-V...
Which of the following steps is the given output?
18 empower 46 provider 77 general 93 opinion
Which element is exactly between “course” and “85” in the second step of the given arrangement?
What is the position of ‘ person’ in step IV?