Java ArrayListʹÓÃ×ܽᣨһ£©
×î½üÒ»Ö±ÔÚʹÓÃJava£¬¸Ð¾õËüµÄÔ½½ç¼ì²é·Ç³£ÓÐЧ¡£ÕâÒ»µã¶ÔÓÚ³õѧÕßÀ´ËµÊǷdz£ÖØÒªµÄ£¨Ìá¸ß³ÌÐòµÄÑϽ÷ÐÔ£©£¬¶ÔÓÚÓоÑéµÄ³ÌÐòÔ±À´ËµÒ²ºÜÓаïÖú¡£JavaÖÐÓÐÒ»¸öºÜÓÐЧµÄArrayListÀà(¶ÁÕß¿ÉÒÔ½áºÏJava API
À´Ñ§Ï°Ëü)£¬¡£ËüºÍÒ»°ãµÄÊý×é²»Ò»Ñù£¬²»ÐèÒªÌáÇ°·ÖÅä¹Ì¶¨µÄ¿Õ¼ä£¨Ê¹ÓñȽÏÁé»î£©£¬Ã¿´ÎʹÓõÄʱºò¿ÉÒÔÌí¼Ó½øеÄÔªËØ£¨¸Ð¾õ¾ÍÊDzÙ×÷¶ÔÓÚ³ÌÐòÔ±À´ËµÍ¸Ã÷»¯ÁË£¬ÓÐÐËȤµÄ¿ÉÒÔ×Ô¼º±àдÀ´ÊµÏÖÕâ¸öÀàµÄһЩ·½·¨£©¡£
1.±ÈÈçÄãÐèÒªÌí¼ÓStringÀàÐ͵ÄÊý×飺
ArrayList <String> s=new ArrayList<String>();//´´½¨ÁËsÀ´±£´æStringÊý×é
s.add("hello");//ÏòsÖÐÌí¼Óhello×Ö·û´®
s.add("arraylist");
for(int i=0;i<s.size();i++)//s.size()ÊÇArrayListµÄÒ»¸ö·½·¨£¬·µ»Ø½á¹ûÊÇsµÄ´óС,¾ÍÏñÊý×éµÄ³¤¶ÈÒ»Ñù
System.out.print(s.get(i)+“ ”);//s.get(i)ÊÇ»ñÈ¡sµÄµÚi¸öÔªËØÁË
ÕâÑùÔÚÖն˾ͻá´òÓ¡³öÈçϽá¹û£ºhello arraylist
2.µ±¶ÁÕßÐèÒª¶¨Òå×Ô¼ºÀ࣬²¢ÇÒÐèÒªÕë¶ÔËüÀ´´´½¨Êý×éµÄ»°£¬¿ÉÒÔÕâÑùʹÓã¨ÕâÀïÎÒÃǼÙÉ趨ÒåÒ»¸öѧÉúÐÅÏ¢£©£º
class Student//ÎÒÃDz»¶¨Òå·½·¨£¨³ý¹¹Ôì·½·¨ÒÔÍ⣩£¬Ò²¾ÍÊÇ˵°ÑStudentÀà×÷ΪCÓïÑÔÖеĽṹÌåÀ´Ê¹ÓÃ
{
String no;//ѧºÅ
String name;//ѧÉúÐÕÃû
String home;//¼Òͥסַ
public Student(String no, String name, String home)
{
this.no=no; this.name=name;this.home=home;
}
}
ArrayList <Student> s=new ArrayList<Student>();
s.add(new("001","Csdn","China"));//Ìí¼ÓÁËÒ»¸öѧÉú
//Èç¹ûÐèÒªÊä³ö»òÕßÊDZðµÄ´¦Àí£¬Çë¶ÁÕ߲ο¼api
ÒÔÉÏ´úÂëƬ¶Î²»¿Éµ¥¶ÀÖ´ÐУ¬ÐèÒªÉÏÏÂÎÄ¡££¨ÔÚÏÂÒ²ÊdzõѧÕߣ¬ËµµÄ²»ºÃµÄ»¹Çë¼ûÁ£¡£©
Ïà¹ØÎĵµ£º
ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔÀí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
private Object data; //ÔªËر¾Éí
private NodeBean next; //ÏÂÒ»¸ö½Úµã
&n ......
´ó¼ÒºÃ£¬ÕâÀïÓÐIBMµÄÈý¸ö³¤ÆÚÐèÇ󣺾ùÊÇÐèÒª2ÄêÒÔÉÏÏà¹Ø¹¤×÷¾Ñ飬ÆäÖÐJavaÒÔ¼°TestingÐèÒªÓ¢Óï¿ÉÒÔ½»Á÷£¬C/Unix²»ÐèÒªÓïÑÔ¡£
Java ´óÁ¬
ÃèÊö£ºJava programming, knowledge in J2SE, SWT/JFace, XML. Eclipse programming, knowledge in eclipse architecture. Clear understanding of plugin development. Hands-on exp ......
JAVAµÄ½çÃæ²¼¾ÖÔÀí£ºÒòΪJavaÊÇ¿çƽ̨ÓïÑÔ£¬Ê¹Óþø¶Ô×ø±êÏÔÈ»»áµ¼ÖÂÎÊÌ⣬¼´ÔÚ²»Í¬Æ½Ì¨¡¢²»Í¬·Ö±æÂÊϵÄÏÔʾЧ¹û²»Ò»Ñù¡£Java ΪÁËʵÏÖ¿çƽ̨µÄÌØÐÔ²¢ÇÒ»ñµÃ¶¯Ì¬µÄ²¼¾ÖЧ¹û£¬Java½«ÈÝÆ÷ÄÚµÄËùÓÐ×é¼þ°²ÅŸøÒ»¸ö“²¼¾Ö¹ÜÀíÆ÷”¸ºÔð¹ÜÀí£¬È磺ÅÅÁÐ˳Ðò£¬×é¼þµÄ´óС£¬Î»Öõȣ¬µ±´°¿ÚÒƶ¯»òµ÷Õû´óСºó×é¼þÈçºÎ±ä»¯µÈ¹ ......
JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®³£ÓõÄÓÐÈý¸öÀࣺjava.lang.String¡¢java.lang.StringBuffer¡¢java.lang.StringBuilder£¬ÕâÈýÕߵĹ²Í¬Ö®´¦¶¼ÊÇfinalÀ࣬²»ÔÊÐí±»¼Ì³Ð£¬ÕâÖ÷ÒªÊÇ´ÓÐÔÄܺͰ²È«ÐÔÉÏ¿¼Âǵģ¬ÒòΪÕ⼸¸öÀ඼ÊǾ³£±»Ê¹ÓÃ×ŵģ¬ÇÒ¿¼Âǵ½·ÀÖ¹ÆäÖеIJÎÊý±»ÐÞ¸ÄÓ°Ïìµ½ÆäËüµÄÓ¦Óá£StringBufferÓëStrin ......
ת £º http://www.jcourse.cn/read/234
2009-03-02 ×÷Õß:
zhangtaolv
ÔÚÎÒÃÇÈÕ³£¿ª·¢ÖУ¬¾³£»áÓöµ½¶ÔÎı¾µÄ²Ù×÷£¬²¢ÇÒÔÚÒ»°ãµÄMISϵͳÖУ¬Îı¾²Ù×÷ÓÈΪ¶à£¬ÈçÓû§Ãû¡¢ÎÄÕÂÄÚÈÝ¡¢ÎÄÕ±êÌâ¡¢ºÏͬÄÚÈݵȡ£ÔÚ֮ǰµÄ½Ì³ÌÖУ¬ÎÒÒ²¸ø´ó¼Ò½²½âÁËJavaÖÐ×î»ù±¾µÄ×Ö·û´®²Ù×÷µÄÀ࣬String¡£ÔÚ֮ǰµÄ½Ì³ÌÖÐÎÒÒ²¸ø´ó¼Ò½²ÁËStr ......