Nok Nok Labs interview question

Java basic question