Cognizant interview question

Can you explain the OOPs concepts in Java with real-time examples

Interview Answer

Anonymous

12 Nov 2025

explained all four OOPs concepts — Encapsulation, Inheritance, Polymorphism, and Abstraction — with small examples. For instance, I gave an example of inheritance using a “Vehicle” base class and “Car/Bike” subclasses to show code reusability and structure.