JavaÖÐ ArrayList¡¢VectorºÍLinkedList µÄʹÓÃ
ArrayListÊÇ×î³£ÓõÄListʵÏÖÀ࣬ÄÚ²¿ÊÇͨ¹ýÊý×éʵÏֵģ¬ËüÔÊÐí¶ÔÔªËؽøÐпìËÙËæ»ú·ÃÎÊ¡£Êý×éµÄȱµãÊÇÿ¸öÔªËØÖ®¼ä²»Äܺ¬ÓГ¿Õ϶”£¬µ±Êý×é´óС²»Âú×ãʱÐèÒªÔö¼Ó´æ´¢ÄÜÁ¦£¬¾ÍÒª½«ÒÑÓÐÊý×éÊý¾Ý¸´ÖƵ½ÐµĴ洢¿Õ¼äÖС£µ±´ÓArrayListµÄÖмäλÖòåÈë»òÕßɾ³ýÔªËØʱ£¬ÐèÒª¶ÔÊý×é½øÐи´ÖÆ¡¢Òƶ¯£¬´ú¼Û±È½Ï¸ß¡£Òò´Ë£¬ËüÊʺÏËæ»ú²éÕҺͱéÀú£¬²»ÊʺϲåÈëºÍɾ³ý¡£
VectorÓëArrayListÒ»Ñù£¬Ò²ÊÇͨ¹ýÊý×éʵÏֵģ¬²»Í¬µÄÊÇËüÖ§³ÖÏ̵߳Äͬ²½£¬¼´Ä³Ò»Ê±¿ÌÖ»ÓÐÒ»¸öÏß³ÌÄܹ»Vector£¬±ÜÃâ¶àÏß³Ìͬʱд¶øÒýÆðµÄ²»Ò»ÖÂÐÔ£¬µ«ÊµÏÖͬ²½ÐèÒªºÜ¸ßµÄ»¨·Ñ£¬Òò´Ë£¬·ÃÎÊËü±È·ÃÎÊAarryListÂý
LinkedListÊÇÓÃÁ´±í½á¹¹´æ´¢Êý¾ÝµÄ£¬ºÜÊʺÏÊý¾ÝµÄ¶¯Ì¬²åÈëºÍɾ³ý£¬Ëæ»ú·ÃÎʺͱéÀúËٶȱȽÏÂý¡£ÁíÍ⣬Ëü»¹ÌṩÁËList½Ó¿ÚÖÐûÓж¨ÒåµÄ·½·¨£¬×¨ÃÅÓÃÓÚ²Ù×÷±íÍ·ºÍ±íβԪËØ£¬¿ÉÒÔµ±×ö¶ÑÕ»¡¢¶ÓÁкÍË«Ïò¶ÓÁÐʹÓá£
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Stack;
import java.util.Vector;
/**
* ÑÝʾ¸÷ÖÖListµÄʹÓÃ
* ListÊÇÄÜά»¤ÔªËصĴÎÐò£¬ËüÔÊÐíÔªËØÖظ´
*/
public class TestList {
/**
* ³õʼ»¯Ò»¸öList
* @param list
*/
public static void init(List list){
if(list != null){
list.add("aaa");
list.add("ccc");
list.add("bbb");
list.add("eee");
list.add("ddd");
}
}
/**
* Êä³öListµÄÄÚÈÝ
* @param list
*/
public static void output(List list){
&nb
Ïà¹ØÎĵµ£º
ÔÎĵØÖ·£ºhttp://www.javaeye.com/topic/626801 Ò»Ö±ÔÞ̾Sun¶Ô´ý¼¼ÊõµÄÑϽ÷ºÍÓÅÑÅ£¨¿ÉÁ¯µÄSun£©¡£Sun JDKÖÐJava¿âµÄÔ´´úÂ룬Á¬×¢ÊͶ¼ÇåÇå³þ³þ¡¢¹æ¹æ·¶·¶£¬javadoc×¢½âµÄʹÓÃҲһ˿²»¹¶£¬¶ÁÆðÀ´ºÜÊìÊæ·þ¡£Òò´Ë£¬ÔÚÈÕ³£¹¤×÷ºÍѧϰÖУ¬¾³£¶Á¶Á Java¿âµÄÔ´´úÂ룬²»ÒàÀÖºõ£¿Èç¹ûÓöµ½¹îÒìÎÊÌ⣬Դ´úÂë ......
jvm classLoader architecture£º
1. Bootstrap ClassLoader/Æô¶¯Àà¼ÓÔØÆ÷
Ö÷Òª¸ºÔðjdk_home/libĿ¼ÏµĺËÐÄ api »ò -Xbootclasspath Ñ¡ÏîÖ¸¶¨µÄjar°ü×°È빤×÷¡£
2. Extension ClassLoader/À©Õ¹Àà¼ÓÔØÆ÷
Ö÷Òª¸ºÔðjdk_home/lib/extĿ¼ÏµÄjar°ü»ò -Djava.ext.dirs Ö¸¶¨Ä¿Â¼ÏµÄjar°ü×°È빤×÷¡£
3 ......
´«ÖDz¥¿ÍJAVAÅàѵOAÏîÄ¿2010-5-12
½ñÌì»»Á˸öнÌÊÒ£¬ÖÕÓÚ½áÊøÁËÃÆÈȵĿÕÆøÁË¡£ÒÔÇ°½ÌÊÒ¿Õµ÷´ó´óµÄÓÐÎÊÌ⣬ÏÖÔÚºÃÁË£¬¿ÉÒÔÒ»Ïí¿Õµ÷µÄÁ¹Ë¬£¬Ö»²»ÊÇΨһÃÀÖв»×ãµÄÊÇ£¬¾ÓÈ»ÓõIJ»ÊǸñÁ¦¿Õµ÷¡£ÔÚ¸ñÁ¦¿Õµ÷´ôÁËËÄÄ꣬ËäÈ»ÔÚÄǶùûÓз¢»Ó³öÎÒ¸üºÃµÄˮƽ£¬µ«ÊÇÈ˱Ͼ¹ÊÇÓиÐÇéµÄ£¬ÎÒÒ²ºÜ°®ÄǸö¸ñÁ¦£¬´ó¹«Ë¾£¬´óÆøÆÇ£¬ÌرðÊÇ£¬ÎÒà ......
³£³£Óöµ½Êý×éÅÅÐòµÄÎÊÌâ.±ÈÈçÎÒÓÐÒ»¸öPersonÀà,ËüµÄʵÀý¶ÔÏó´æ´¢ÔÚArrayListÊý×éÖÐ,ÏÖÔÚÒª°ÑArrayListÊý×éÖеÄPerson¶ÔÏó°´ÕÕÄêÁäÅÅÐò.
ÆäʵÕâÖÖÇé¿ö¾³£Óöµ½.
ÏÂÃæ¸ø³öÔ´´úÂë:
1:Person.JavaÎļþ:-------------------------------
public class Person{
String name;
int age;
public Person(String name,int age){ ......