/StackExample

How we add three stack in list

Primary LanguageJava

StackExample

How we add three stack in list ?

Go for Main Class :

https://github.com/mertinal/StackExample/blob/master/src/stackexample/Main.java

or

Download

Download project with git and open project in Netbeans

git clone https://github.com/mertinal/StackExample.git

Desription

We can easly add Stacks into list with ArrayList in java. Stack type array list :

ArrayList<Stack> stacks = new ArrayList<Stack>();

Adding Stack object into ArrayList :

stacks.add(new Stack<Integer>());

stacks.add(new Stack<Integer>());

stacks.add(new Stack<Integer>());