stacks and queues the peek button push and pop are the two primary stack operations howeverit' sometimes useful to be able to read the value from the top of the stack without removing it the peek operation does this by pushing the peek button few timesyou'll see the value of the item at top copied to the number text fieldbut the item is not removed from the stackwhich remains unchanged notice that you can peek only at the top item by designall the other items are invisible to the stack user stack size stacks are typically smalltemporary data structureswhich is why we've shown stack of only cells of coursestacks in real programs may need bit more room than thisbut it' surprising how small stack needs to be very long arithmetic expressionfor examplecan be parsed with stack of only dozen or so cells java code for stack let' examine programstack javathat implements stack using class called stackx listing contains this class and short main(routine to exercise it listing the stack java program /stack java /demonstrates stacks /to run this programc>java stackapp ///////////////////////////////////////////////////////////////class stackx private int maxsize/size of stack array private long[stackarrayprivate int top/top of stack //public stackx(int /constructor maxsize /set array size stackarray new long[maxsize]/create array top - /no items yet //public void push(long /put item on top of stack stackarray[++topj/increment topinsert item