File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Meaning of FIFO behaviour Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Meaning of FIFO behaviour " Watch "Meaning of FIFO behaviour " New topic

Meaning of FIFO behaviour

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

I am reading about what Collection class to use when we want FIFO behaviour .

Please tell me what does it mean by FIFO behaviour . I think when we add elements to a COntainer (DataStructures)

For example say :

please let me know what is the First in here , whether it will be One or Three in this case ??

Thanks i advance .

Save India From Corruption - Anna Hazare.
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

FIFO means "First In, First Out". It's like a queue or a line at Starbucks. since "ONE" was the first thing you put it, it is at the beginning.

LIFO means "Last In, First Out". this is like a stack of plates. the last item you put on it is on top, and will be the first one to come out.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you very much.
I agree. Here's the link:
subject: Meaning of FIFO behaviour
It's not a secret anymore!