Chinaunix首页 | 论坛 | 博客
  • 博客访问: 434272
  • 博文数量: 54
  • 博客积分: 610
  • 博客等级: 上士
  • 技术积分: 721
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-24 10:52
文章分类

全部博文(54)

文章存档

2013年(27)

2012年(11)

2011年(16)

分类: Java

2013-06-20 21:43:38

Basic concepts
The Java container library takes the idea of "holding your objects" and divides it into two distinct concepts, expressed as the basic interfaces of the library:
1.
Collection: a sequence of individual elements with one or more rules applied to them. A List must hold the elements in the way that they were inserted, a Set cannot have duplicate elements, and a Queue produces the elements in the order determined by a queuing discipline (usually the same order in which they are inserted).
2.
Map: a group of key-value object pairs, allowing you to look up a value using a key. An ArrayList allows you to look up an object using a number, so in a sense it associates numbers to objects. A map allows you to look up an object using another object. It’s also called an associative array, because it associates objects with other objects, or a dictionary, because you look up a value object using a key object just like you look up a definition using a word. Maps are powerful programming tools.
阅读(1457) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~