Qus: What is the difference between abstraction and encapsulation?
It is a feature of OOPs. It is used to hide the unnecessary information or data from the user but shows the essential data that is useful for the user. It can be achieved by using the interface and the abstract class. In interfaces, only the methods are exposed to the end-user. The best example of abstraction is a TV remote. The user only interacts with the outer interface that is nothing but keys. The user only knows which key to press for what function.
It is also a feature of OOP. It is used to bind up the data into a single unit called class. It provides the mechanism which is known as data hiding. It is an important feature of OOPs. It prevents to access data members from the outside of the class. It is also necessary from the security point of view.