Stack is a class in java . And we are allowed to create array of objects.
Stack[] B =new Stack[5];
B[0].push(“1”);
B[1].push(1);
System.out.println(B[0].peek());
System.out.println(B[1].peek());
But on compilation I get this.

So How to create Array of Stacks?