Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 Ìåϵ¼°Æä±à³ÌµÄ¹ý³Ì

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

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

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

JAVAÖеÄSingletonģʽ

µ¥Àýģʽ£¬¹ËÃû˼Ò壬ֻÄÜÓÐÒ»¸öʵÀý¡£
Ò».´Ó¶àḬ̈߳²È«ËµÆð£¬ÈçÏÂͼ´úÂ룬´ËÎÊÌâ¿ÉÒÔÓÃsynchronized¹Ø¼ü×ÖÀ´½â¾ö¡£¸Ã·½·¨È±µã£ºÃ¿Ò»¸öÏß³ÌÔÚ»ñȡʵÀý¶ÔÏó֮ǰ¶¼ÒªÔÚsynchronizedÉÏͬ²½µÄ¶ÔÏóÉϽøÐеȴý£¬Òò´ËЧÂʲ»¸ß¡£
¶þ.Double Check·½·¨£¬¼ûÏÂͼ´úÂë¡£Double CheckµÄ³õÖÔÊÇÖ»Óе±instanceΪNULLʱִÐеÄÏ̲߳ÅÐèÒªÔÚ ......

JAVA³ÌÐòÔ±ÃæÊÔ32ÎÊ

µÚÒ»£¬Ì¸Ì¸final, finally, finalizeµÄÇø±ð¡£
final ÐÞÊηû£¨¹Ø¼ü×Ö£©Èç¹ûÒ»¸öÀà±»ÉùÃ÷Ϊfinal£¬Òâζ×ÅËü²»ÄÜÔÙÅÉÉú³öеÄ×ÓÀ࣬²»ÄÜ×÷Ϊ¸¸Àà±»¼Ì³Ð¡£Òò´ËÒ»¸öÀ಻Äܼȱ»ÉùÃ÷Ϊ abstractµÄ£¬ÓÖ±»ÉùÃ÷ΪfinalµÄ¡£½«±äÁ¿»ò·½·¨ÉùÃ÷Ϊfinal£¬¿ÉÒÔ±£Ö¤ËüÃÇÔÚʹÓÃÖв»±»¸Ä±ä¡£±»ÉùÃ÷ΪfinalµÄ±äÁ¿±ØÐëÔÚÉùÃ÷ʱ¸ø¶¨³õÖµ£¬¶øÔÚÒÔ ......

java ²åÈëÊý¾Ýµ½ mysql ÂÒÂë ×î¼Ñ½â¾ö

 ÊÖ¶¯½¨±í£º
CREATE TABLE `excel` (
  `id` int(11) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `passwd` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;  ×¢ÒâÊÇgb2312
È»ºóÔÚÁ¬½ÓÊý¾Ý¿âʱ¼ÓÉÏ:
useUnicode=true&characterEncoding=gb2312.
¾ÍokÀ²£¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ