Bloomberg interview question

basic questions about Java, reverse a stack