Java Stack implementation.