Capgemini interview question

Java related questions. Logic building programatical questions.