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

VectorÀàÔÚJava±à³ÌÖеÄÓ¦ÓÃ

VectorÀàÔÚJava±à³ÌÖеÄÓ¦ÓÃ
Vector Àà Ìá ¹© ÁË Êµ ÏÖ ¿É Ôö ³¤ Êý ×é µÄ ¹¦ ÄÜ£¬ Ëæ ×Å ¸ü ¶à Ôª ËØ ¼Ó Èë Æä ÖУ¬
Êý ×é ±ä µÄ ¸ü ´ó¡£ ÔÚ É¾ ³ý Ò» Щ Ôª ËØ Ö® ºó£¬ Êý ×é ±ä С¡£
Vector ÓÐ Èý ¸ö ¹¹ Ôì º¯ Êý£¬
public Vector(int initialCapacity,int capacityIncrement)
public Vector(int initialCapacity)
public Vector()
---- Vector ÔË ÐРʱ ´´ ½¨ Ò» ¸ö ³õ ʼ µÄ ´æ ´¢ ÈÝ Á¿initialCapacity£¬ ´æ ´¢ ÈÝ Á¿ ÊÇ ÒÔcapacityIncrement ±ä Á¿ ¶¨ Òå µÄ Ôö Á¿ Ôö ³¤¡£
³õ ʼ µÄ ´æ ´¢ ÈÝ Á¿ ºÍcapacityIncrement ¿É ÒÔ ÔÚVector µÄ ¹¹ Ôì º¯ Êý ÖÐ ¶¨ Òå¡£
µÚ ¶þ ¸ö ¹¹ Ôì º¯ Êý Ö» ´´ ½¨ ³õ ʼ ´æ ´¢ ÈÝ Á¿¡£ µÚ Èý ¸ö ¹¹ Ôì º¯ Êý ¼È ²» Ö¸ ¶¨
³õ ʼ µÄ ´æ ´¢ ÈÝ Á¿ Ò² ²» Ö¸ ¶¨capacityIncrement¡£
---- Vector Àà Ìá ¹© µÄ ·Ã ÎÊ ·½ ·¨ Ö§ ³Ö Àà ËÆ Êý ×é ÔË Ëã ºÍ ÓëVector ´ó С Ïà
¹Ø µÄ ÔË Ëã¡£ Àà ËÆ Êý ×é µÄ ÔË Ëã ÔÊ Ðí Ïò Á¿ ÖÐ Ôö ¼Ó£¬ ɾ ³ý ºÍ ²å Èë Ôª ËØ¡£
Ëü ÃÇ Ò² ÔÊ Ðí ²â ÊÔ Ê¸ Á¿ µÄ ÄÚ ÈÝ ºÍ ¼ì Ë÷ Ö¸ ¶¨ µÄ Ôª ËØ£¬ Óë ´ó С Ïà ¹Ø µÄ
ÔË Ëã ÔÊ Ðí ÅÐ ¶¨ ×Ö ½Ú ´ó С ºÍ ʸ Á¿ ÖÐ Ôª ËØ ²» Êý Ä¿¡£
---- ÏÖ Õë ¶Ô ¾­ ³£ Óà µ½ µÄ ¶Ô Ïò Á¿ Ôö£¬ ɾ£¬ ²å ¹¦ ÄÜ ¾Ù Àý Ãè Êö£º
addElement(Object obj)
---- °Ñ ×é ¼þ ¼Ó µ½ Ïò Á¿ β ²¿£¬ ͬ ʱ ´ó С ¼Ó1£¬ Ïò Á¿ ÈÝ Á¿ ±È ÒÔ Ç° ´ó1
insertElementAt(Object obj, int index)
---- °Ñ ×é ¼þ ¼Ó µ½ Ëù ¶¨ Ë÷ Òý ´¦£¬ ´Ë ºó µÄ ÄÚ ÈÝ Ïò ºó ÒÆ ¶¯1 ¸ö µ¥ λ
setElementAt(Object obj, int index)
---- °Ñ ×é ¼þ ¼Ó µ½ Ëù ¶¨ Ë÷ Òý ´¦£¬ ´Ë ´¦ µÄ ÄÚ ÈÝ ±» ´ú Ìæ¡£
---- removeElement(Object obj) °Ñ Ïò Á¿ ÖÐ º¬ ÓÐ ±¾ ×é ¼þ ÄÚ ÈÝ ÒÆ ×ß¡£
---- removeAllElements() °Ñ Ïò Á¿ ÖÐ Ëù ÓÐ ×é ¼þ ÒÆ ×ߣ¬ Ïò Á¿ ´ó С Ϊ0¡£
---- Àý È磺
import java.lang.System;
import java.util.Vector;
import java.util.Emumeration;
public class Avector{
public static void main(String args[])
{
0. Vector v=new Vector();
1. v.addElement("one");
2. addElement("two");
3. v.addElement("three");
4. v.insertElementAt("zero",0);
5. v.insertElementAt("oop",3);
6. v.setElementAt("three",3);
7. v.setElementAt("four",4);
8. v.removeAllElements();
}
}
VectorÖеı仯Çé¿ö£º
1. one 2. one 3


Ïà¹ØÎĵµ£º

java ·¾¶ÖеĿոñÎÊÌâ

Èô·¾¶Öдø¿Õ¸ñ£¬Ôò
1. uri.getpath();·µ»ØµÄ·¾¶ÖеĿոñÈÔÒÔ“¿Õ¸ñ”µÄÐÎʽ³öÏÖ£¬Èç/F:/MyEclipse Workspace/project/bin/...
³ý´ËÖ®Í⣬URL·µ»ØµÄÒ»Çз¾¶ÖеĿոñ¶¼ÒÔ“%20”µÄÐÎʽ³öÏÖ£¬uri.toString()Ò²ÒÔ“%20”µÄÐÎʽ³öÏÖ¡£
2. new File(String filePath);½ÓÊÜÕýÈ·URI¸ñʽµÄ²ÎÊýº ......

Effective Java ѧϰ±Ê¼Ç(4)

Õâ¸öÔ­ÔòºÜ¼òµ¥£¬¾ÍÊÇʹÓÃ˽Óй¹Ô캯Êý·ÀÖ¹À౻ʵÀý»¯¡£ ÓÐʱ£¬ÎÒÃÇ»áдһЩ¹¤¾ßÀ࣬Èçjava.lang.Math »òÊÇ java.util.Arrays, ÕâЩÀàÖж¼ÊǾ²Ì¬º¯Êý£¬ÔÚÉè¼ÆµÄʱºò£¬ÕâЩÀಢ²»ÊÇÓÃÀ´±»ÊµÀý»¯µÄ¡£Õâ¸öʱºò£¬¾ÍºÜÓбØÒª°Ñ¹¹Ô캯Êý˽Óл¯¡£ public class UtilityClass {

private UtilityClass() {
throw ne ......

Java ±ê×¼ÈÕÖ¾¹¤¾ß Log4j µÄʹÓ㨸½Ô´´úÂ룩

Java ±ê×¼ÈÕÖ¾¹¤¾ß Log4j µÄʹÓ㨸½Ô´´úÂ룩
        Ô´´úÂëÏÂÔØ
        Log4j ÊÇÊÂʵÉ쵀 Java ±ê×¼ÈÕÖ¾¹¤¾ß¡£»á²»»áÓà Log4j ÔÚÒ»¶¨³Ì¶ÈÉÏ¿ÉÒÔ˵ÊǺâÁ¿Ò»¸ö¿ª·¢ÈËÔ±ÊÇ·ñÊÇһλºÏ¸ñµÄ
Java ³ÌÐòÔ±µÄ±ê×¼¡£Èç¹ûÄãÊÇÒ»Ãû Java ³ÌÐòÔ±£¬Èç¹ûÄ㻹 ......

java³£ÓÃ×é¼þÏÂÔصØÖ·

q        ¿ªÔ´Êý¾Ý¿âMySQLµÄ¹Ù·½ÍøÕ¾
http://www.mysql.com
q        JSTL±ê×¼±êÇ©¿âµÄÏÂÔØÍøÕ¾
http://java.sun.com/products/jsp/jstl
q        Struts1µÄ¹Ù·½ÍøÕ¾
http://struts.apache.org
q &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ