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

java»ù´¡ÎÊ´ð£¨2£©

11¡¢HashMapºÍHashtableµÄÇø±ð¡£
    HashMapÊÇHashtableµÄÇáÁ¿¼¶ÊµÏÖ£¨·ÇḬ̈߳²È«µÄʵÏÖ£©£¬ËûÃǶ¼Íê³ÉÁËMap½Ó¿Ú£¬Ö÷ÒªÇø±ðÔÚÓÚHashMapÔÊÐí¿Õ£¨null£©¼üÖµ£¨key£©,ÓÉÓÚ·ÇḬ̈߳²È«£¬Ð§ÂÊÉÏ¿ÉÄܸßÓÚHashtable¡£
HashMapÔÊÐí½«null×÷Ϊһ¸öentryµÄkey»òÕßvalue£¬¶øHashtable²»ÔÊÐí¡£
HashMap°ÑHashtableµÄcontains·½·¨È¥µôÁË£¬¸Ä³ÉcontainsvalueºÍcontainsKey¡£ÒòΪcontains·½·¨ÈÝÒ×ÈÃÈËÒýÆðÎó½â¡£
Hashtable¼Ì³Ð×ÔDictionaryÀ࣬¶øHashMapÊÇJava1.2Òý½øµÄMap interfaceµÄÒ»¸öʵÏÖ¡£
×î´óµÄ²»Í¬ÊÇ£¬HashtableµÄ·½·¨ÊÇSynchronizeµÄ£¬¶øHashMap²»ÊÇ£¬ÔÚ¶à¸öÏ̷߳ÃÎÊHashtableʱ£¬²»ÐèÒª×Ô¼ºÎªËüµÄ·½·¨ÊµÏÖͬ²½£¬¶øHashMap ¾Í±ØÐëΪ֮ÌṩÍâͬ²½¡£
HashtableºÍHashMap²ÉÓõÄhash/rehashËã·¨¶¼´ó¸ÅÒ»Ñù£¬ËùÒÔÐÔÄܲ»»áÓкܴóµÄ²îÒì¡£
12¡¢final, finally, finalizeµÄÇø±ð¡£
¡¡¡¡final ÓÃÓÚÉùÃ÷ÊôÐÔ£¬·½·¨ºÍÀ࣬·Ö±ð±íʾÊôÐÔ²»¿É±ä£¬·½·¨²»¿É¸²¸Ç£¬À಻¿É¼Ì³Ð¡£
finallyÊÇÒì³£´¦ÀíÓï¾ä½á¹¹µÄÒ»²¿·Ö£¬±íʾ×ÜÊÇÖ´ÐС£
finalizeÊÇObjectÀàµÄÒ»¸ö·½·¨£¬ÔÚÀ¬»øÊÕ¼¯Æ÷Ö´ÐеÄʱºò»áµ÷Óñ»»ØÊÕ¶ÔÏóµÄ´Ë·½·¨£¬¿ÉÒÔ¸²¸Ç´Ë·½·¨ÌṩÀ¬»øÊÕ¼¯Ê±µÄÆäËû×ÊÔ´»ØÊÕ£¬ÀýÈç¹Ø±ÕÎļþµÈ¡£
13¡¢sleep() ºÍ wait() ÓÐʲôÇø±ð?
    sleepÊÇÏß³ÌÀࣨThread£©µÄ·½·¨£¬µ¼Ö´ËÏß³ÌÔÝÍ£Ö´ÐÐÖ¸¶¨Ê±¼ä£¬¸øÖ´Ðлú»á¸øÆäËûỊ̈߳¬µ«ÊǼà¿Ø״̬ÒÀÈ»±£³Ö£¬µ½Ê±ºó»á×Ô¶¯»Ö¸´¡£µ÷ÓÃsleep²»»áÊͷŶÔÏóËø¡£
waitÊÇObjectÀàµÄ·½·¨£¬¶Ô´Ë¶ÔÏóµ÷ÓÃwait·½·¨µ¼Ö±¾Ï̷߳ÅÆú¶ÔÏóËø£¬½øÈëµÈ´ý´Ë¶ÔÏóµÄµÈ´ýËø¶¨³Ø£¬Ö»ÓÐÕë¶Ô´Ë¶ÔÏó·¢³önotify·½·¨£¨»ònotifyAll£©ºó±¾Ï̲߳ŽøÈë¶ÔÏóËø¶¨³Ø×¼±¸»ñµÃ¶ÔÏóËø½øÈëÔËÐÐ״̬¡£
14¡¢OverloadºÍOverrideµÄÇø±ð¡£OverloadedµÄ·½·¨ÊÇ·ñ¿ÉÒԸı䷵»ØÖµµÄÀàÐÍ?
·½·¨µÄÖØдOverridingºÍÖØÔØOverloadingÊÇJava¶à̬ÐԵIJ»Í¬±íÏÖ¡£ÖØдOverridingÊǸ¸ÀàÓë×ÓÀàÖ®¼ä¶à̬ÐÔµÄÒ»ÖÖ±íÏÖ£¬ÖØÔØOverloadingÊÇÒ»¸öÀàÖжà̬ÐÔµÄÒ»ÖÖ±íÏÖ¡£Èç¹ûÔÚ×ÓÀàÖж¨Òåij·½·¨ÓëÆ丸ÀàÓÐÏàͬµÄÃû³ÆºÍ²ÎÊý£¬ÎÒÃÇ˵¸Ã·½·¨±»ÖØд (Overriding)¡£×ÓÀàµÄ¶ÔÏóʹÓÃÕâ¸ö·½·¨Ê±£¬½«µ÷ÓÃ×ÓÀàÖеĶ¨Ò壬¶ÔËü¶øÑÔ£¬¸¸ÀàÖеĶ¨ÒåÈçͬ±»"ÆÁ±Î"ÁË¡£Èç¹ûÔÚÒ»¸öÀàÖж¨ÒåÁ˶à¸öͬÃûµÄ·½·¨£¬ËüÃÇ»òÓв»Í¬µÄ²ÎÊý¸öÊý»òÓв»Í¬µÄ²ÎÊýÀàÐÍ£¬Ôò³ÆΪ·½·¨µÄÖØÔØ(Overloading)¡£OverloadedµÄ·½·¨ÊÇ¿ÉÒԸı䷵»ØÖµµÄÀàÐÍ¡£
15¡¢errorºÍexceptionÓÐʲôÇø±ð?
error ±íʾ»Ö¸´²»ÊDz


Ïà¹ØÎĵµ£º

½âÎöJavaÀàºÍ¶ÔÏóµÄ³õʼ»¯¹ý³Ì

ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......

java¾­Ñé

µÚÒ»£¬Ì¸Ì¸final, finally, finalizeµÄÇø±ð¡£
×î³£±»Îʵ½¡£
µÚ¶þ£¬Anonymous Inner Class (ÄäÃûÄÚ²¿Àà) ÊÇ·ñ¿ÉÒÔextends(¼Ì³Ð)ÆäËüÀ࣬ÊÇ·ñ¿ÉÒÔimplements(ʵÏÖ)interface(½Ó¿Ú)?
µÚÈý£¬Static Nested Class ºÍ Inner ClassµÄ²»Í¬£¬ËµµÃÔ½¶àÔ½ºÃ(ÃæÊÔÌâÓеĺÜÁýͳ)¡£
µÚËÄ£¬&ºÍ&&µÄÇø±ð¡£
Õâ¸öÎʵúÜÉÙ¡£ ......

java³ý·¨µÄÏÝÚå

Java³ý·¨ÔËËãµÄÏÝÚå
 
³ý·¨ÔËËãË­²»»á°¡£¬ºÜ¶àÈ˲»Ð¼Ò»¹Ë£¬ÕæÊÇÎÞÖªÕßÎÞη£¡
Æäʵ³ý·¨¡¢ÇóÓàÔËËãÓÐһЩÏÝÚå¡£Ò»µ©¼ÆËã·¢ÉúÁËÎÊÌ⣬»¹ºÜ²»ºÃÕÒ¡£²»ºÃÕÒµÄÔ­ÒòÖ÷ÒªÊÇÎÊÌâµÄżȻÐÔÌ«Ç¿£¬Èç¹ûÄãÖªµÀ¿ÉÄÜ·¢ÉúʲôÎÊÌ⣬ÄãµÄ´úÂë¾Í¿ÉÒÔдµÃ¸ü°²È«¡£
 
Êýѧ³ý·¨¹æ¶¨£¬0²»ÄÜ×ö³ýÊý£¬ÒòΪ»áµÃµ½Ò»¸öÎÞÇî´óÊý¾Ý¡£
&nb ......

javaÎļþ²Ù×÷

   File file = new File("d:/test.txt");
   FileOutputStream fos = new FileOutputStream(file);
   DataOutputStream dos = new DataOutputStream(fos);
   String s = "abcdef";
   byte[] byteArray = s.getBytes();
   dos.write(byteArray); ......

JavaÔ¶³ÌͨѶÏà¹Ø¼¼Êõ

Ò»¡¢»ùÓÚRMIµÄÒ»´ÎÍêÕûµÄÔ¶³ÌͨÐŹý³ÌµÄÔ­Àí£º
1. ¿Í»§¶Ë·¢ÆðÇëÇó£¬ÇëÇóת½»ÖÁRMI¿Í»§¶ËµÄstubÀࣻ
2. stubÀཫÇëÇóµÄ½Ó¿Ú¡¢·½·¨¡¢²ÎÊýµÈÐÅÏ¢½øÐÐÐòÁл¯£»
3. »ùÓÚsocket½«ÐòÁл¯ºóµÄÁ÷´«ÊäÖÁ·þÎñÆ÷¶Ë£»
4. ·þÎñÆ÷¶Ë½ÓÊÕµ½Á÷ºóת·¢ÖÁÏàÓ¦µÄskeltonÀࣻ
5. skeltonÀཫÇëÇóµÄÐÅÏ¢·´ÐòÁл¯ºóµ÷ÓÃʵ¼ÊµÄ´¦ÀíÀࣻ
6. ´¦Àí ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ