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

Effective Java¶ÁÊé±Ê¼Ç

package chape8;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* µÚ°ËÕ ͨÓóÌÐòÉè¼Æ
* µÚ45Ìõ£º ½«¾Ö²¿±äÁ¿µÄ×÷ÓÃÓò¼õСµ½×îС
*   ½«¾Ö²¿±äÁ¿µÄ×÷ÓÃÓò×îС»¯¡£¿ÉÒÔÔöÇ¿´úÂëµÄ¿É¶ÁºÍ¿Éά»¤ÐÔ£¬²¢½µµÍ³ö´íµÄ¿ÉÄÜÐÔ
*   Ҫʹ×÷ÓÃÓò×îС£¬×îÓÐÁ¦µÄ·½·¨¾ÍÊÇÔÚµÚÒ»´ÎʹÓÃËüµÄʱºòÉùÃ÷£»Èç¹ûÌáÇ°ÉùÃ÷»áÔì³É
* һƬ»ìÂÒ£»Ò²»á·ÖÉ¢×¢ÒâÁ¦
* ¼¸ºõÿ¸ö¾Ö²¿±äÁ¿µÄÉùÃ÷¶¼Ó¦¸Ã°üÀ¨Ò»¸ö³õʼ»¯µÃ±í´ïʽ£»
* ÀýÈ磺
* for(Element e : c)
* {
* dosomthing(e);
* }
* Õâ¸öÊÇjava1.5ÒÔÉϵİ汾µÄforÑ­»·µÄÊ×ÏÈ¿¼ÂǵÄд·¨£»
* ¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£
* ÔÙÀ´¿´£ºÏÂÃæÊÇjava1.5ÒÔÇ°µÄforÑ­»·
* List c = new ArrayList ();
Iterator it = c.iterator();
while(it.hasNext())
{
it.next();
}
List c1 = new ArrayList();
Iterator it1 = c1.iterator();
while(it.hasNext())
{
it1.next();
}
* µ«Äã±È½ÏÒ»ÏÂÕâÁ½¸öÑ­»·£¬µÚ¶þ¸öÑ­»·ÊÇÎÒÒªµÄµÚ¶þ¸öÑ­»· ÎÒΪÁË·½±ã½«µÚÒ»¸öÑ­»·
* ¸´ÖÆÁËÒ»·Ý £¬È»ºó¸Ä±äÁ˱äÁ¿µÄÃû³ÆÀ´´ïµ½Á½¸öÑ­»·µÄÄ¿µÄ£¬這樣寫 ide²»會報錯
* µ«ÊÇÏÔÈ»ÎÒÍüÁËÐÞ¸ÄһЩ±ØÐëÐ޸ĵĶ«Î÷£¬µ«ÊǵÚÒ»¸öÑ­»·ÖеÄitÔÚµÚ¶þ¸öµÄ×÷ÓÃÓòÖÐÒÀÈ»ÓÐЧ ÕâÑù»áÔì³ÉÄãÈÏΪ
* ĪÃûÆäÃîµÄÎÊÌ⣻
* Èç¹û這樣寫£º
*   List c = new ArrayList ();
for (Iterator it = c.iterator();it.hasNext();)
{
it.next();
}
List c1 = new ArrayList();
while(Iterator it1 = c1.iterator();it.hasNext();)
{
it1.next();
}
    µÚÒ»個Ñ­環ÖеÄ變Á¿µÄ×÷ÓÃÓò²»會Ó°響µ½µÚ¶þ個 這樣ide¾Í會報錯 ¿ÉÒÔ¼°時¸Ä³É£»
   
    將¾Ö²¿變Á¿µÄ×÷ÓÃÓò×îС»¯ ʹ·½·¨Ð¡¶ø¼¯ÖУ¬將ÄÜ·Ö開µÄ·½·¨¶¼·Ö開£»
* @author lee
*
*/
public class Chape45 {
public static void main(String[] args) {
/*List c = new ArrayList ();
Iterator it = c.iterator();
while(it.hasNext())
{
it.next();
}
List c1 = new ArrayList();
Iterator it1 = c1.iterator();
while(it.hasNext())
{
it1


Ïà¹ØÎĵµ£º

java¼¯ºÏÀà

 ArrayList ºÍVectorÊDzÉÓÃÊý×鷽ʽ´æ´¢Êý¾Ý£¬´ËÊý×éÔªËØÊý´óÓÚʵ¼Ê´æ´¢µÄÊý¾ÝÒÔ±ãÔö¼ÓºÍ²åÈëÔªËØ£¬¶¼ÔÊÐíÖ±½ÓÐòºÅË÷ÒýÔªËØ£¬µ«ÊDzåÈëÊý¾ÝÒªÉè¼Æµ½Êý×éÔªËØÒƶ¯µÈÄÚ´æ²Ù×÷£¬ËùÒÔË÷ÒýÊý¾Ý¿ì²åÈëÊý¾ÝÂý£¬VectorÓÉÓÚʹÓÃÁËsynchronized·½·¨£¨Ḭ̈߳²È«£©ËùÒÔÐÔÄÜÉϱÈArrayListÒª²î£¬LinkedListʹÓÃË«ÏòÁ´±íʵÏÖ´æ´¢£¬°´Ðòº ......

javaÏß³Ì

1.Ï̴߳´½¨µÄÁ½ÖÖ·½Ê½
1£©À©Õ¹ThreadÀಢÖØдpublic void run()·½·¨
ps£º
¶¨ÒåỊ̈߳º
class myThread extends Thread(){
         public void run(){
                System.out.println("Ju ......

Java¸ß¼¶£­£­JavaÏß³ÌÔËÐÐÕ»ÐÅÏ¢µÄ»ñÈ¡

 
Java¸ß¼¶£­£­JavaÏß³ÌÔËÐÐÕ»ÐÅÏ¢µÄ»ñÈ¡
·¢²¼Ê±¼ä£º2007.11.14 05:10     À´Ô´£ºÈüµÏÍø¼¼ÊõÉçÇø     ×÷Õߣºbaocl
Ò»¡¢ÎÊÌâµÄÒýÈë
ÎÒÃÇÔÚJava³ÌÐòÖÐʹÓÃÈÕÖ¾¹¦ÄÜ£¨JDK Log»òÕßLog4J£©µÄʱºò£¬»á·¢ÏÖLogϵͳ»á×Ô¶¯°ïÎÒÃÇ´òÓ¡³ö·á¸»µÄÐÅÏ¢£¬¸ñʽһ°ãÈçÏ£º
[ÔËÐÐʱ¼ä] [µ ......

java½âÎöxmlÎļþËÄÖÖ·½Ê½

 from: http://blog.csdn.net/WOSHISUNXIANGFU/archive/2008/08/25/2828634.aspx
 1.½éÉÜ
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒÌض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµ ......

ʹÓà Java Native Interface µÄ×î¼Ñʵ¼ù

 Java™ ±¾»ú½Ó¿Ú£¨Java Native Interface£¬JNI£©ÊÇÒ»¸ö±ê×¼µÄ Java API£¬ËüÖ§³Ö½« Java ´úÂëÓëʹÓÃÆäËû±à³ÌÓïÑÔ±àдµÄ´úÂëÏ༯³É¡£Èç¹ûÄúÏ£ÍûÀûÓÃÒÑÓеĴúÂë×ÊÔ´£¬ÄÇô¿ÉÒÔʹÓà JNI ×÷ΪÄú¹¤¾ß°üÖеĹؼü×é¼þ —— ±ÈÈçÔÚÃæÏò·þÎñ¼Ü¹¹£¨SOA£©ºÍ»ùÓÚÔƵÄϵͳÖС£µ«ÊÇ£¬Èç¹ûÔÚʹÓÃʱδעÒâijЩÊÂÏÔò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ