aijava

          welcome to my online log ! open java new world! Taste java charm........
          posts - 1, comments - 4, trackbacks - 0, articles - 42
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          java基礎學習9(java.util.Vector)

          Posted on 2006-11-12 23:02 閱讀(180) 評論(0)  編輯  收藏 所屬分類: java基礎學習系列
          import? java.util.Vector;

          public?class? MainClass? {
          ?? public?static? void? main ( String?args [])?{

          ???? //?initial?size?is?3,?increment?is?2
          ???? Vector<Integer>?v?=? new? Vector<Integer> ( 3 ,? 2 ) ;

          ???? System.out.println ( "Initial?size:?"? +?v.size ()) ;
          ???? System.out.println ( "Initial?capacity:?"? +?v.capacity ()) ;

          ???? v.addElement ( 1 ) ;
          ???? v.addElement ( 2 ) ;

          ???? System.out.println ( "First?element:?"? +?v.firstElement ()) ;
          ???? System.out.println ( "Last?element:?"? +?v.lastElement ()) ;

          ???? if? ( v.contains ( 3 ))
          ?????? System.out.println ( "Vector?contains?3." ) ;
          ?? }
          }

          http://freehost13.websamba.com
          主站蜘蛛池模板: 锦州市| 黎平县| 县级市| 新郑市| 奉化市| 丹凤县| 江油市| 哈尔滨市| 宾川县| 廊坊市| 醴陵市| 措美县| 阿图什市| 东丽区| 神池县| 库伦旗| 大兴区| 辽阳县| 内丘县| 平塘县| 荣昌县| 广丰县| 保德县| 武胜县| 宁国市| 临漳县| 拉萨市| 巴青县| 昆山市| 蓬安县| 黄浦区| 临桂县| 平定县| 石门县| 南川市| 新龙县| 仁怀市| 察隅县| 元阳县| 吴堡县| 边坝县|