Capgemini Engineering interview question

Core java basics