Start learning 50% faster. Sign in now
Get Started with ixamBee
Start learning 50% faster. Sign in nowEncapsulation 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.
The country will send its soldiers to solve the extremely confused and complicated situation in Afghanistan.
In the given question, a word has been given and there are three ways in which the word has been used, in similar or different forms. You need to see w...
Principal
i. The school principal announced a new policy for student uniforms.
ii. He invested a large sum of money ...
Tamper
(i) To tamper with a constitution that had so proved its quality seemed not so much a sacrilege as a folly.
(ii) At least he was tr...
In the following question, a word has been used in sentences in THREE different ways. Choose the option corresponding to the sentences in which the usa...
In the following question, a word has been used in sentences in THREE different ways. Choose the option corresponding to the sentences in which the usa...
In the given question, a word has been given and there are three ways in which the word has been used, in similar or different forms. Find out which o...
In the following question, a word has been given and there are three ways in which the word has been used, in similar or different forms. You need to s...
In the following question, a word has been used in sentences in THREE different ways. Choose the option corresponding to the sentences in which the us...
(i) prohibit
(ii) reveal
(iii) forbid
(iv) transfer