Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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õѧÕߣ¬ËµµÄ²»ºÃµÄ»¹Çë¼ûÁ£¡£©


Ïà¹ØÎĵµ£º

JavaÉè¼Æģʽ֮:IteratorÁ´±íģʽ

ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔ­Àí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
   
    private Object data; //ÔªËر¾Éí
    private NodeBean next; //ÏÂÒ»¸ö½Úµã
   
  &n ......

¡¾IBMÐèÇóÐÅÏ¢¡¿ JAVA, C/UNIXÐèÇó

´ó¼ÒºÃ£¬ÕâÀïÓÐ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ÖÐÓÃÓÚ´¦Àí×Ö·û´®µÄ¡°ÈýÐֵܡ±

     JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®³£ÓõÄÓÐÈý¸öÀࣺjava.lang.String¡¢java.lang.StringBuffer¡¢java.lang.StringBuilder£¬ÕâÈýÕߵĹ²Í¬Ö®´¦¶¼ÊÇfinalÀ࣬²»ÔÊÐí±»¼Ì³Ð£¬ÕâÖ÷ÒªÊÇ´ÓÐÔÄܺͰ²È«ÐÔÉÏ¿¼Âǵģ¬ÒòΪÕ⼸¸öÀ඼ÊǾ­³£±»Ê¹ÓÃ×ŵģ¬ÇÒ¿¼Âǵ½·ÀÖ¹ÆäÖеIJÎÊý±»ÐÞ¸ÄÓ°Ïìµ½ÆäËüµÄÓ¦Óá£StringBufferÓëStrin ......

Java¿ª·¢ Ö® StringBufferºÍStringBuilder(1)


ת £º http://www.jcourse.cn/read/234
2009-03-02 ×÷Õß:
zhangtaolv
ÔÚÎÒÃÇÈÕ³£¿ª·¢ÖУ¬¾­³£»áÓöµ½¶ÔÎı¾µÄ²Ù×÷£¬²¢ÇÒÔÚÒ»°ãµÄMISϵͳÖУ¬Îı¾²Ù×÷ÓÈΪ¶à£¬ÈçÓû§Ãû¡¢ÎÄÕÂÄÚÈÝ¡¢ÎÄÕ±êÌâ¡¢ºÏͬÄÚÈݵȡ£ÔÚ֮ǰµÄ½Ì³ÌÖУ¬ÎÒÒ²¸ø´ó¼Ò½²½âÁËJavaÖÐ×î»ù±¾µÄ×Ö·û´®²Ù×÷µÄÀ࣬String¡£ÔÚ֮ǰµÄ½Ì³ÌÖÐÎÒÒ²¸ø´ó¼Ò½²ÁËStr ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ