JAVA³ÌÐòÔ±ÃæÊÔ32ÎÊ
µÚÒ»£¬Ì¸Ì¸final, finally, finalizeµÄÇø±ð¡£
final ÐÞÊηû£¨¹Ø¼ü×Ö£©Èç¹ûÒ»¸öÀà±»ÉùÃ÷Ϊfinal£¬Òâζ×ÅËü²»ÄÜÔÙÅÉÉú³öеÄ×ÓÀ࣬²»ÄÜ×÷Ϊ¸¸Àà±»¼Ì³Ð¡£Òò´ËÒ»¸öÀ಻Äܼȱ»ÉùÃ÷Ϊ abstractµÄ£¬ÓÖ±»ÉùÃ÷ΪfinalµÄ¡£½«±äÁ¿»ò·½·¨ÉùÃ÷Ϊfinal£¬¿ÉÒÔ±£Ö¤ËüÃÇÔÚʹÓÃÖв»±»¸Ä±ä¡£±»ÉùÃ÷ΪfinalµÄ±äÁ¿±ØÐëÔÚÉùÃ÷ʱ¸ø¶¨³õÖµ£¬¶øÔÚÒÔºóµÄÒýÓÃÖÐÖ»ÄܶÁÈ¡£¬²»¿ÉÐ޸ġ£±»ÉùÃ÷ΪfinalµÄ·½·¨Ò²Í¬ÑùÖ»ÄÜʹÓ㬲»ÄÜÖØÔØ
finally ÔÙÒì³£´¦ÀíʱÌṩ finally ¿éÀ´Ö´ÐÐÈκÎÇå³ý²Ù×÷¡£Èç¹ûÅ׳öÒ»¸öÒì³££¬ÄÇôÏàÆ¥ÅäµÄ catch ×Ó¾ä¾Í»áÖ´ÐУ¬È»ºó¿ØÖƾͻá½øÈë finally ¿é£¨Èç¹ûÓеĻ°£©¡£
finalize?·½·¨Ãû¡£Java ¼¼ÊõÔÊÐíʹÓà finalize() ·½·¨ÔÚÀ¬»øÊÕ¼¯Æ÷½«¶ÔÏó´ÓÄÚ´æÖÐÇå³ý³öȥ֮ǰ×ö±ØÒªµÄÇåÀí¹¤×÷¡£Õâ¸ö·½·¨ÊÇÓÉÀ¬»øÊÕ¼¯Æ÷ÔÚÈ·¶¨Õâ¸ö¶ÔÏóûÓб»ÒýÓÃʱ¶ÔÕâ¸ö¶ÔÏóµ÷Óõġ£ËüÊÇÔÚ Object ÀàÖж¨ÒåµÄ£¬Òò´ËËùÓеÄÀ඼¼Ì³ÐÁËËü¡£×ÓÀา¸Ç finalize() ·½·¨ÒÔÕûÀíϵͳ×ÊÔ´»òÕßÖ´ÐÐÆäËûÇåÀí¹¤×÷¡£finalize() ·½·¨ÊÇÔÚÀ¬»øÊÕ¼¯Æ÷ɾ³ý¶ÔÏó֮ǰ¶ÔÕâ¸ö¶ÔÏóµ÷Óõġ£
µÚ¶þ£¬Anonymous Inner Class (ÄäÃûÄÚ²¿Àà) ÊÇ·ñ¿ÉÒÔextends(¼Ì³Ð)ÆäËüÀ࣬ÊÇ·ñ¿ÉÒÔimplements(ʵÏÖ)interface(½Ó¿Ú)?
ÄäÃûµÄÄÚ²¿ÀàÊÇûÓÐÃû×ÖµÄÄÚ²¿Àà¡£²»ÄÜextends(¼Ì³Ð) ÆäËüÀ࣬µ«Ò»¸öÄÚ²¿Àà¿ÉÒÔ×÷Ϊһ¸ö½Ó¿Ú£¬ÓÉÁíÒ»¸öÄÚ²¿ÀàʵÏÖ¡£
µÚÈý£¬Static Nested Class ºÍ Inner ClassµÄ²»Í¬£¬ËµµÃÔ½¶àÔ½ºÃ(ÃæÊÔÌâÓеĺÜÁýͳ)¡£
Nested Class £¨Ò»°ãÊÇC++µÄ˵·¨£©£¬Inner Class (Ò»°ãÊÇJAVAµÄ˵·¨)¡£JavaÄÚ²¿ÀàÓëC++ǶÌ×Àà×î´óµÄ²»Í¬¾ÍÔÚÓÚÊÇ·ñÓÐÖ¸ÏòÍⲿµÄÒýÓÃÉÏ¡£¾ßÌå¿É¼ûhttp: //www.frontfree.net/articles/services/view.asp?id=704&page=1
×¢£º ¾²Ì¬ÄÚ²¿ÀࣨInner Class£©Òâζ×Å1´´½¨Ò»¸östaticÄÚ²¿ÀàµÄ¶ÔÏ󣬲»ÐèÒªÒ»¸öÍⲿÀà¶ÔÏó£¬2²»ÄÜ´ÓÒ»¸östaticÄÚ²¿ÀàµÄÒ»¸ö¶ÔÏó·ÃÎÊÒ»¸öÍⲿÀà¶ÔÏó
µÚËÄ£¬&ºÍ&&µÄÇø±ð¡£
&ÊÇλÔËËã·û¡£&&ÊDz¼¶ûÂß¼ÔËËã·û¡£
µÚÎ壬HashMapºÍHashtableµÄÇø±ð¡£
¶¼ÊôÓÚMap½Ó¿ÚµÄÀ࣬ʵÏÖÁ˽«Î©Ò»¼üÓ³Éäµ½Ìض¨µÄÖµÉÏ¡£
HashMap ÀàûÓзÖÀà»òÕßÅÅÐò¡£ËüÔÊÐíÒ»¸ö null ¼üºÍ¶à¸ö null Öµ¡£
Hashtable ÀàËÆÓÚ HashMap£¬µ«ÊDz»ÔÊÐí null ¼üºÍ null Öµ¡£ËüÒ²±È HashMap Âý£¬ÒòΪËüÊÇͬ²½µÄ¡£
µÚÁù£¬Collection ºÍ CollectionsµÄÇø±ð¡£
CollectionsÊǸöjava.utilϵÄÀ࣬Ëü°üº¬Óи÷ÖÖÓйؼ¯ºÏ²Ù×÷µÄ¾²Ì¬·½·¨¡£
CollectionÊǸöjava.utilϵĽÓ
Ïà¹ØÎĵµ£º
SetºÍÊýѧÖеļ¯ºÏÊÇͬһ¸ö¸ÅÄ¾ÍÊÇûÓÐÖظ´ÔªËصļ¯ºÏ¡£
ÕâƪÎÄÕÂÖ÷ÒªÂÛÊöÁËSetÊÇÈçºÎʵÏÖ"ûÓÐÖظ´ÔªËØ"£¨no duplicate elements£©µÄ£¬ÒÔ¼°²ûÊöÁËʲôÊÇ“Öظ´”£¨duplicate£©£¬ÊÇÏàͬµÄµØÖ·¿Õ¼ä£¿ÊÇequalsµÄ·µ»ØֵΪtrue£¿ÊÇcompareToµÄ·µ»ØֵΪ0 £¿»¹ÊÇÓÐÏàͬµÄhashCode£¿±¾ÎÄ»¹¸ø³öÁËÔÚʲôÇé¿öÏÂʹÓÃʲà ......
package barchartdemo1;
import java.awt.Font;
import java.io.FileOutputStream;
import java.io.IOException;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.Numbe ......
Ê×ÏÈ£¬Ç¿ÁÒÍƼöÄãÏȲο¼Sun¹Ù·½µÄJava´úÂë/±à³Ì¹æ·¶£º
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
Äã¿ÉÒÔ´òÆÆÒÔÉϵÄÈÎÒ»¹æÔò£¬²»¹ýÒ»¶¨ÒªÓиöºÃÀíÓÉ£¬²¢ÇҼǼÏÂÀ´¡£
ÓÀÔ¶£¬ÓÀÔ¶£¬ÓÀÔ¶²»ÒªÔÚûÓмǼ¶ÑÕ»¸ú×ÙÐÅÏ¢£¨stack trace£©»òÊÇÖØÐÂÅ׳öÒì³£µÄÇé¿öϲ¶»ñÒì³££¬Ë׳Ɠ³ÔµôÒì³£&rd ......
finalÀࣺΪ·ÀÖ¹ËûÈË´ÓÄãµÄÀàÉÏÅÉÉúÐÂÀ࣬´ËÀàÊDz»¿ÉÀ©Õ¹µÄ¡£
¡¡¡¡¶¯Ì¬µ÷ÓñȾ²Ì¬µ÷Óû¨·ÑµÄʱ¼äÒª³¤¡£
¡¡¡¡³éÏóÀࣺ¹æ¶¨Ò»¸ö»ò¶à¸ö³éÏó·½·¨µÄÀà±¾Éí±ØÐ붨ÒåΪabstract¡£
¡¡¡¡Àý£º public abstract string getDescripition
¡¡¡¡JavaÖеÄÿһ¸öÀ඼ÊÇ´ÓObjectÀàÀ©Õ¹¶øÀ´µÄ¡£
¡¡¡¡objectÀàÖеÄequalºÍtoString·½· ......
µ¥Àýģʽ£¬¹ËÃû˼Ò壬ֻÄÜÓÐÒ»¸öʵÀý¡£
Ò».´Ó¶àḬ̈߳²È«ËµÆð£¬ÈçÏÂͼ´úÂ룬´ËÎÊÌâ¿ÉÒÔÓÃsynchronized¹Ø¼ü×ÖÀ´½â¾ö¡£¸Ã·½·¨È±µã£ºÃ¿Ò»¸öÏß³ÌÔÚ»ñȡʵÀý¶ÔÏó֮ǰ¶¼ÒªÔÚsynchronizedÉÏͬ²½µÄ¶ÔÏóÉϽøÐеȴý£¬Òò´ËЧÂʲ»¸ß¡£
¶þ.Double Check·½·¨£¬¼ûÏÂͼ´úÂë¡£Double CheckµÄ³õÖÔÊÇÖ»Óе±instanceΪNULLʱִÐеÄÏ̲߳ÅÐèÒªÔÚ ......