HCLTech Interview Question

It was Java Technical