public boolean push ( Object obj ) { // Cannot add beyond maximum capacity if ( isFull ( ) ) { return false ; } // Grow if we are at capacity if ( size == objects . length ) { grow ( ) ; } objects [ size ++ ] = obj ; return true ; }
Pushes an object on to the top of the stack .