Pregunta de entrevista de Cognizant

Some basic Java and oops question.