Pergunta de entrevista da empresa Cognizant

What is OOPs and Difference between Polymorphism and Abstraction?

Resposta da entrevista

Sigiloso

6 de out. de 2025

OOPs stands for Object-Oriented Programming System. It’s a programming approach that organizes the code into objects that contain both data and behavior. The main principles of OOPs are: Encapsulation – wrapping data and methods into a single unit (class). Abstraction – hiding unnecessary implementation details. Inheritance – reusing code by creating new classes from existing ones. Polymorphism – performing a single action in different ways. Abstraction hides the implementation details, while Polymorphism defines different behaviors for the same function depending on the object.