Marlabs interview question

Basic Java and OOPs questions