16/03/2010
Collection
collection : temporary data
data base : permanent data
Arraylist
Pros.
- more efficient than array (extend, minimize = flexible)
- arraylist can have different datatype, such as int, string and ocject of the class.
Arraylist al = new Arraylist();
al.Add(5);
al.Add(10);
al.Remove(5);
foreach(<type> <variable> in <list>)
*The list must be same datatype.
Hashtable hash = new Hashtable();
("key", "value")
hash.Containts
hash.ContaintsValue
*Remove only key
Stack k = new Stack();
Queue days = new Queue();
0 件のコメント:
コメントを投稿