This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Meaning of FIFO behaviour " Watch "Meaning of FIFO behaviour " New topic
Author

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
Bartender

Joined: Oct 02, 2003
Posts: 11448
    
  16

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.
 
jQuery in Action, 2nd edition
 
subject: Meaning of FIFO behaviour