Driver program to test above functions
public static void main ( String [ ] args ) { StackWithMax s = new StackWithMax ( ) ; s . push ( 20 ) ; System . out . println ( s . getMax ( ) ) ; s . push ( 10 ) ; System . out . println ( s . getMax ( ) ) ; s . push ( 50 ) ; System . out . println ( s . getMax ( ) ) ; } }