• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Last 10 numbers dialed on my cell phone

 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this an example of an ArrayList Collection?
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could be...of course, it could be a LinkedList or some other implementation of List (a Queue implementation with a length limit of ten seems probable to me). Suffice to say, it would be an implementation of java.util.List -- unless, of course, your phone only stores the last ten unique numbers, in which case a java.util.Set might be more appropriate. (Of course, you would want a Set that also provides List-type capibilities).
Your phone book would be an implementation of a java.util.Map--probably a java.util.SortedMap, since it not only stores a Name:Number::Key:Value relationship, but it sorts on the Name for display.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic