HCLTech interview question

Basic Java