Simplify360 interview question

OOPs concepts in Java