Driver Code
public static void main ( String [ ] args ) { Stack < Integer > N1 = new Stack < Integer > ( ) ; N1 . add ( 5 ) ; N1 . add ( 8 ) ; N1 . add ( 7 ) ; N1 . add ( 4 ) ; Stack < Integer > N2 = new Stack < Integer > ( ) ; N2 . add ( 2 ) ; N2 . add ( 1 ) ; N2 . add ( 3 ) ; Stack < Integer > res = addStack ( N1 , N2 ) ; display ( res ) ; } }