Cognizant interview question

Oops concept, swapping numbers,inheritance, polymorphism and encapsulation