wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Use of a Stack class in real world Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Use of a Stack class in real world " Watch "Use of a Stack class in real world " New topic
Author

Use of a Stack class in real world

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,


As everybody knows that a Stack which is used for LIFO mechanism .



But how does this will be useful in a real world programming ??

Because as far as i know for List implemenatation classes ArrayList or a LinkedList would be sufficient depending upon the purpose .

please advise even my question is a dump one .


Save India From Corruption - Anna Hazare.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

Ravi Kiran V wrote:... Because as far as i know for List implemenatation classes ArrayList or a LinkedList would be sufficient depending upon the purpose..

Not sure what you meant by this. But there are so many uses of Stack in the computing world. Few of them here


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

java.util.Stack implements the List interface. It adds some methods to view and remove the last element.
A real world example is a stack-based parser.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
eric totte
Greenhorn

Joined: Aug 13, 2010
Posts: 10
A good introduction to the use of a Stack would be to evaluate arithmetic operations, an example is shown here
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thanks totte , william.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

William? Do you mean Wouter instead?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Sure, John.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thanks Wouter Oet .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of a Stack class in real world
 
Similar Threads
String Comparison ?
Data structure in real world
what should be the first servlet to display when application launches?
To our Spanish speakers
Just another day on the job