answersLogoWhite

0


Best Answer

Encapsulation allows programmers to separate interface from implementation, thus creating a better overall design, where each module is individually simpler and doesn't need to know about the other modules. See related links as well.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

The ability to make changes in your code without breaking the code of all others who use your code is a key benefit of encapsulation. You should always hide implementation details. To elaborate, you must always have your variables as private and then have a set of public methods that others can use to access your variables. Since the methods are public anyone can access them, but since they are in your class you can ensure that the code works the way that is best for you. So in a situation that you want to alter your code, all you have to do is modify your methods. No one gets hurt because i am just using your method names in my code and the code inside your method doesnt bother me much.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the benefit using Encapsulation?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is different between inheritance and encapsulation?

wrapping up of data and function into a single unit is called encapsulation where polymorphism is the ability to take more than one form


What is the benefit of using encapsulation?

The ability to make changes in your code without breaking the code of all others who use your code is a key benefit of encapsulation. You should always hide implementation details. To elaborate, you must always have your variables as private and then have a set of public methods that others can use to access your variables. Since the methods are public anyone can access them, but since they are in your class you can ensure that the code works the way that is best for you. So in a situation that you want to alter your code, all you have to do is modify your methods. No one gets hurt because i am just using your method names in my code and the code inside your method doesnt bother me much.


How do you achieve encapsulation by using class?

By making fields private. That way, they can't be directly accessed from the outside - the are hidden, that is, encapsulated.


3 pillars of object oriented programming?

abstraction, inheritance, encapsulation, and polymorphism.


Is encapsulation a characteristic of procedural or object oriented programming?

Encapsulation is one of the four pillars of object-oriented programming. The other three are inheritance, polymorphism and abstraction.

Related questions

What is the name of the process of building a frame around network layer information?

Encapsulation. Actually, this is one type of encapsulation; encapsulation occurs at several layers.Encapsulation. Actually, this is one type of encapsulation; encapsulation occurs at several layers.Encapsulation. Actually, this is one type of encapsulation; encapsulation occurs at several layers.Encapsulation. Actually, this is one type of encapsulation; encapsulation occurs at several layers.


What are the benefit of using EOQ?

"what are the benefit of using EOQ?"


What is different between inheritance and encapsulation?

wrapping up of data and function into a single unit is called encapsulation where polymorphism is the ability to take more than one form


What is the benefit of using encapsulation?

The ability to make changes in your code without breaking the code of all others who use your code is a key benefit of encapsulation. You should always hide implementation details. To elaborate, you must always have your variables as private and then have a set of public methods that others can use to access your variables. Since the methods are public anyone can access them, but since they are in your class you can ensure that the code works the way that is best for you. So in a situation that you want to alter your code, all you have to do is modify your methods. No one gets hurt because i am just using your method names in my code and the code inside your method doesnt bother me much.


How do you achieve encapsulation by using class?

By making fields private. That way, they can't be directly accessed from the outside - the are hidden, that is, encapsulated.


Which command sets the encapsulation on a Serial interface back to the Cisco default?

encapsulation hdlc


What is one benefit to using a checking account that is not a benefit of using a savings account?

proof of payment.


3 pillars of object oriented programming?

abstraction, inheritance, encapsulation, and polymorphism.


Why encapsulation is needed in java?

Encapsulation is not needed in Java, or any other language. But it's useful. Encapsulation is used to minimise the number of potential dependencies with the highest probability of change propagation.


Is encapsulation a characteristic of procedural or object oriented programming?

Encapsulation is one of the four pillars of object-oriented programming. The other three are inheritance, polymorphism and abstraction.


What is the best benefit of using click bank?

The very best benefit of using Click bank is that the registration process is absolutely free. This is probably the single best benefit of using Click bank.


The three basic principles of object-oriented design?

Encapsulation,Inheritance and Polimorphisim...