1. Vector
Vector v = new Vector()
.....................(25)
.....................(25,5) 达到25后,每次增加5, 依次为, 30,35,40
增值太小,频繁操作内存
...太大, 浪费内存
v.add("test")
String s = v.latstElement()
v.add(0,"test")
v.add(1,"test")
v.clear
Iterator it = v.iterator()
v.size()
2. Stack
Stack s = new Statck()
s.push("1")
s.push("2")
String s1 = (String)s.pop(), 取得最后压入的元素
String s2 = (String)s.peek(), 取得压入的第一个元素,但不弹出
3. Map
HashMap, HashSet
HashTable ht = new HashTable()
ht.put("key","value");
if (ht.contain("key")
4. Iterator
Iterator it = ht.iterator();
while(it.hasNext())
{
Object obj = it.next()
}
Vector v = new Vector()
.....................(25)
.....................(25,5) 达到25后,每次增加5, 依次为, 30,35,40
增值太小,频繁操作内存
...太大, 浪费内存
v.add("test")
String s = v.latstElement()
v.add(0,"test")
v.add(1,"test")
v.clear
Iterator it = v.iterator()
v.size()
2. Stack
Stack s = new Statck()
s.push("1")
s.push("2")
String s1 = (String)s.pop(), 取得最后压入的元素
String s2 = (String)s.peek(), 取得压入的第一个元素,但不弹出
3. Map
HashMap, HashSet
HashTable ht = new HashTable()
ht.put("key","value");
if (ht.contain("key")
4. Iterator
Iterator it = ht.iterator();
while(it.hasNext())
{
Object obj = it.next()
}