Thread: Using Stacks
View Single Post
  #2 (permalink)  
Old 11-27-2007, 11:45 AM
Eranga's Avatar
Eranga Eranga is offline
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Something like this, a simple stack

Code:
import java.util.Stack; public class StacksDemo { public static void main(String[] arguments) { Stack newStack = new Stack(); newStack.push("10"); newStack.push("20"); newStack.push("30"); newStack.push("40"); // and many more items to push while(!newStack.empty()) { System.out.println(newStack.pop()); } } }
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote