Cognizant Interview Question

Java oops concepts and explain difference between abstraction and encapsulation.

Interview Answer

Anonymous

Jan 23, 2021

Abstraction is the method of hiding the unwanted information. Whereas encapsulation is a method to hide the data in a single entity or unit along with a method to protect information from outside. Whereas encapsulation can be implemented using by access modifier i.e. private, protected and public.