Stack - Java

By Solve Program

Stack - Java

Java Programming
Java Programming

Stacks Class

This class contain max size of stack array, top of element, and stack array for String value.


Stacks Method

This method is used for initializing a size of stack array. It's make an array with stack mode. This method used a LIFO (Last in First out) mode.


Push Method

Push method is used for inserting a value for stack array.


Pop Method

Pop method is used for removing a value for stack array.


Peek Method

This method used to retrieve or fetch the first element of the stack array or the element present at the top of stack array.


Is Empty Method

This method is for checking an array and operating an array with no items in array.


Is Full Method

This method is for checking an array and operating an array with items in array. So it's same with max size an stack array.


Main Method

Main method used for operating this stack array like inserting value and removing value in stack array.