Pregunta de entrevista de Infosys

To write snippets code of java based on the scenario