Opening Hours :7AM to 9PM
Import java.util.*; class StackPush { void list() { Stack<Integer> al=new Stack<Integer>(); al.push(20); al.push(10); al.push(30); al.push(40); al.push(50); System.out.println("The List Items Are "+al); } } class Main { public static void main(String aargs[]) { StackPush d=new StackPush(); d.list(); } }
import java.util.*; class StackPop { void list() { Stack<Integer> al=new Stack<Integer>(); al.push(20); al.push(10); al.push(30); al.push(40); al.push(50); System.out.println("The List Items Are "+al); al.pop(); System.out.println("After Poping The List Items Are "+al); } } class Main { public static void main(String aargs[]) { StackPop d=new StackPop(); d.list(); } }
import java.util.*; class StackPeek { void list() { Stack<Integer> al=new Stack<Integer>(); al.push(20); al.push(10); al.push(30); al.push(40); al.push(50); System.out.println("The List Items Are "+al); System.out.println(al.peek()); } } class Main { public static void main(String aargs[]) { StackPeek d=new StackPeek(); d.list(); } }
import java.util.*; class StackEmpty { void list() { Stack<Integer> al=new Stack<Integer>(); al.push(20); al.push(10); al.push(30); al.push(40); al.push(50); System.out.println("The List Items Are "+al); System.out.println(al.empty()); } } class Main { public static void main(String aargs[]) { StackEmpty d=new StackEmpty(); d.list(); } }
import java.util.*; class StackSearch { void list() { Stack<Integer> al=new Stack<Integer>(); al.push(20); al.push(10); al.push(30); al.push(40); al.push(50); System.out.println("The List Items Are "+al); System.out.println(al.search(500)); } } class Main { public static void main(String aargs[]) { StackSearch d=new StackSearch(); d.list(); } }