BT Group interview question

Basics of java