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

java

1  String ºÍStringBufferµÄÇø±ð
      JAVAƽ̨ÌṩÁËÁ½¸öÀࣺStringºÍStringBuffer£¬ËüÃÇ¿ÉÒÔ´¢´æºÍ²Ù×÷×Ö·û´®£¬¼´°üº¬¶à¸ö×Ö·ûµÄ×Ö·ûÊý¾Ý¡£StringÀàÌṩµÄÊýÖµ²»¿É¸Ä±äµÄ×Ö·û´®¡£StringBufferÀàÌṩµÄ×Ö·û´®½øÐÐÐ޸ġ£µ±ÖªµÀ×Ö·ûÊý¾ÝÒª¸Ä±äµÄʱºòÄã¾Í¿ÉÒÔʹÓÃStringBuffer£¬¿ÉÒÔʹÓÃStringBuffersÀ´¶¯Ì¬¹¹Ôì×Ö·ûÊý¾Ý¡£
2  ˵³öServletµÄÉúÃüÖÜÆÚ£¬²¢Ëµ³öServletºÍCGIµÄÇø±ð¡£
      £¨1£©Servlet±»·þÎñÆ÷ʵÀý»¯ºó£¬ÈÝÆ÷ÔËÐÐÆäinit·½·¨
      £¨2£©ÇëÇóµ½´ïʱÔËÐÐÆäservice·½·¨£¬service·½·¨×Ô¶¯ÅÉDzÔËÐÐÓëÇëÇó¶ÔÓ¦µÄdoXXX·½·¨£¨doGet£¬doPost£©µÈ£¬
      £¨3£©µ±·þÎñÆ÷¾ö¶¨½«ÊµÀýÏú»ÙµÄʱºòµ÷ÓÃÆädestroy·½·¨¡£
      ÓëcgiµÄÇø±ðÔÚÓÚservlet´¦ÓÚ·þÎñÆ÷½ø³ÌÖУ¬Ëüͨ¹ý
       (1)¶àÏ̷߳½Ê½ÔËÐÐÆäservice·½·¨£¬Ò»¸öʵÀý¿ÉÒÔ·þÎñÓÚ¶à¸öÇëÇó ¶øCGI¶Ôÿ¸öÇëÇ󶼲úÉúеĽø³Ì£¬
       (2)servletÆäʵÀýÒ»°ã²»»áÏú»Ù£¬CGI·þÎñÍê³Éºó¾ÍÏú»Ù£¬ËùÒÔЧÂÊÉϵÍÓÚservlet¡£
3 HashMapºÍHashTableÇø±ð
      £¨1£©HashMapÔÊÐíÒ»¸önull¼ü£¬¶à¸önullÖµ£» HashTableµÄ¼üºÍÖµ¾ù²»ÔÊÐíΪnull¡£µ±get()·½·¨·µ»Ønullֵʱ£¬¼´¿ÉÒÔ±íʾHashMapÖÐûÓиüü£¬Ò²¿ÉÒÔ±íʾ¸Ã¼üËù¶ÔÓ¦µÄֵΪnull¡£Òò´Ë£¬ÔÚHashMapÖв»ÄÜÓÉget()·½·¨À´ÅжÏHashMapÖÐÊÇ·ñ´æÔÚij¸ö¼ü£¬¶øÓ¦¸ÃÓÃcontainsKey()·½·¨À´ÅжÏ
      £¨2£©¶¼ÊµÏÖMap½Ó¿Ú£¬HashTableÊÇDictionaryµÄ×ÓÀà¡£
      £¨3£©HashTableÊÇͬ²½µÄ£»HashMapͨ¹ýCollectionsµÄͬ²½·½·¨µÃµ½Í¬²½¡£Map Collections.synchronizedMap(Map m)
Õâ¸ö·½·¨·µ»ØÒ»¸öͬ²½µÄMap£¬Õâ¸öMap·â×°Á˵ײãµÄHashMapµÄËùÓз½·¨£¬Ê¹µÃµ×²ãµÄHashMap¼´Ê¹ÊÇÔÚ¶àÏ̵߳Ļ·¾³ÖÐÒ²ÊÇ°²È«µÄ¡£
4 Ïß³Ì״̬£¨http://lavasoft.blog.51cto.com/62575/27069£©
   1¡¢Ð½¨×´Ì¬£¨New£©£ºÐ´´½¨ÁËÒ»¸öÏ̶߳ÔÏó¡£
   2¡¢¾ÍÐ÷״̬£¨Runnable£©£ºÏ̶߳ÔÏó´´½¨ºó£¬ÆäËûÏ̵߳÷ÓÃÁ˸öÔÏóµÄstart()·½·¨¡£¸Ã״̬µÄÏß³ÌλÓÚ¿ÉÔËÐÐÏ̳߳ØÖУ¬±äµÃ¿ÉÔËÐУ¬µÈ´ý»ñÈ¡CPUµÄʹÓÃȨ¡£
   3¡¢ÔËÐÐ״̬£¨Running£©£º¾ÍÐ÷״̬µÄÏ̻߳ñÈ¡


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

JAVA Ìåϵ¼°Æä±à³ÌµÄ¹ý³Ì

 JAVA Ìåϵ¼°Æä±à³ÌµÄ¹ý³Ì
  °¥£¬±ÏÒµÁËÒ²Ò»¶Îʱ¼äÁË£¬Ö»ÖªµÀÌìÌì³­´úÂ룬 JAVA µÄ»ù´¡ÖªÊ¶»ù±¾ÊÇÍüµôÁË£¬¼ÓÉÏÒÔǰһֱûÓÐϵͳµØѧϰ¹ý£¬¸Ð¾õ¿ìÒª·ÏÁË¡£»¹ÊǺúþ²ÏÂÐÄÀ´Ñ§Ñ§»ù´¡°É¡£²»ÄÜÌìÌ쿼³­´úÂë¹ýÈÕ×Ó°¡¡£¡£¡£¡££¨ÏÂÎÄ´ó¶àÀ´×Կα¾ÒÔ¼°Ò»Ð©¼¼ÊõÊÓƵÉϵÄÄÚÈÝ£¬»ù±¾Àí½âÁËһЩÁË£¬Ê£ÏµÄÓÉÒÔºóµÄѧϰÂýÂýÔ ......

Java¼¯ºÏÀàList/Set/MapµÄÇø±ðºÍÁªÏµ

 
Ò»¡¢Array £¬ Arrays
JavaËùÓГ´æ´¢¼°Ëæ»ú·ÃÎÊÒ»Á¬´®¶ÔÏó”µÄ×ö·¨£¬arrayÊÇ×îÓÐЧÂʵÄÒ»ÖÖ¡£
1¡¢
ЧÂʸߣ¬µ«ÈÝÁ¿¹Ì¶¨ÇÒÎÞ·¨¶¯Ì¬¸Ä±ä¡£
array»¹ÓÐÒ»¸öȱµãÊÇ£¬ÎÞ·¨ÅжÏÆäÖÐʵ¼Ê´æÓжàÉÙÔªËØ£¬lengthÖ»ÊǸæËßÎÒÃÇarrayµÄÈÝÁ¿¡£
2¡¢JavaÖÐÓÐÒ»¸öArraysÀ࣬רÃÅÓÃÀ´²Ù×÷array¡£
   
a ......

Java ÄÚ²¿Àà

¶¨ÒåÔÚÒ»¸öÀàÄÚ²¿µÄÀà½ÐÄÚ²¿À࣬°üº¬ÄÚ²¿ÀàµÄÀà³ÆΪÍⲿÀà¡£
ÄÚ²¿Àà¿ÉÒÔÉùÃ÷public¡¢protected¡¢privateµÈ·ÃÎÊÏÞÖÆ£¬
¿ÉÒÔÉùÃ÷ΪabstractµÄ¹©ÆäËûÄÚ²¿Àà»òÍⲿÀà¼Ì³ÐÓëÀ©Õ¹£¬
»òÕßÉùÃ÷Ϊstatic¡¢finalµÄ£¬Ò²¿ÉÒÔʵÏÖÌض¨µÄ½Ó¿Ú¡£
staticµÄÄÚ²¿ÀàÐÐΪÉÏÏóÒ»¸ö¶ÀÁ¢µÄÀ࣬
·ÇstaticÔÚÐÐΪÉÏÀàËÆÀàµÄÊôÐÔ»ò·½·¨ÇÒ½ûÖ¹ÉùÃ÷s ......

Java СÀý×Ó£ºÏÂÔز¢±£´æÍøÂçС˵

±¾Ê¾Àý´ÓÍøÉÏÏÂÔØÒ»±¾Ð¡Ëµ£¬²¢±£´æΪ UTF-8 ¸ñʽ¡£
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.MalformedURLException; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ