Abstraction is a method of removing the unnecessary details in the code and focusing on the relevant parts. For example, instead of writing a function that multiplies two numbers, we can write a function “multiply” and use it to multiply any number with any number. Abstraction is a way of representing some specific data. Encapsulation is a way of hiding the complexity of something and exposing only the parts you wish to expose. For example, if you have a class that has one or more private fields that you use to store the data, then you are in encapsulation. The class contains the data and has methods that expose the public data.