Accenture interview question

Java core