Delete Stack15.java

This commit is contained in:
2026-02-15 14:31:13 +00:00
parent dfc46361a9
commit 40339a2c67

View File

@@ -1,31 +0,0 @@
//15. write a java code to demonstrate stack
import java.util.*;
public class Stack15
{
public static void main(String[] args)
{
Stack<String> food = new Stack<String>();
food.push("Butter Chicken");
food.push("Dal Makhani");
food.push("Kadhai Paneer");
food.push("Prawns Koliwada");
food.push("Crab Soup");
Iterator<String> itr = food.iterator();
while(itr.hasNext());
{
System.out.println(itr.next());
}
String Food = food.peek();
System.out.println("The Top food item is: " +food);
food.pop();
System.out.println("After Pop:");
Iterator<String> newItr = food.iterator();
while(newItr.hasNext());
{
System.out.println(newItr.next());
}
}
}