Revature interview question

Java