CBNITS interview question

OPPS concepts and Coding , I did those code using java