HCLTech interview question

Java programs