Sysco LABS interview question

Java codes to make sure i know this