





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






Sagar B V 4AL18CS
Here is an example that creates a stack, pushes several integer objects onto it, and then pops them off again: // Demonstrate the stack class. import java.util.*; class StackDemo { static void showpush(stack
Static void showpop(stack
public static void main(String args[]) { stack
The following produce the output produced by the program: push(42) stack: [42] push(66) stack: [42,66] push(99) stack: [42,66,99] pop -> 99 stack: [42,66] Element on stack top : Element is found at position 2 Element not found