Free help with homework

Why join Brainly?

Hi there! Have questions about your homework? At Brainly, there are 60 million students who want to help each other learn. Questions are usually answered in less than 10 minutes. Try it for yourself by posting a question! :D

Hi there! Have questions about your homework? At Brainly, there are 60 million students who want to help each other learn. Questions are usually answered in less than 10 minutes. Try it for yourself by posting a question! :D

Difference between abstraction and encapsulation

Answers

This Is a Certified Answer

×

Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.

Computer Science: Abstraction means representing an object/class in relation to what it does to clients or outside world. So the methods or functions which are public ie., the public interface is what is important here. The implementation details of how the functions are achieved is hidden from the client. Abstraction can be done at multiple levels - classes, sub classes etc.. There is no reference to the state of the objects here.

Encapsulation refers to the state of the object. means putting together the state (property) of the object along with methods to access the state. This can be done with different ways of access modifiers ie., public, private and protected. Essentially, the state of the object is hidden from the outside view of the object by encapsulation. There is data access security here. Encapsulation refers to implementation of the class and its interface.

Encapsulation comes after the abstraction process is first done. Encapsulation is part of abstraction process.