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ϵĽÓ
Ïà¹ØÎĵµ£º
Ò»°ãµÄÊÊÓÃÓÚS40µÄJAVAÈí¼þ¶¼¿ÉÒÔ×°ÔÚŵ»ùÑÇ3110cÉÏ,°üÀ¨ÓÎÏ·,µç×ÓÊé,Ó¦ÓÃÈí¼þ ʲôÊÇJAVAÈí¼þÄØ£¿
JavaÊÇÓÉSun΢ϵͳ¹«Ë¾Ëù·¢Õ¹³öÀ´µÄ³ÌÐòÓïÑÔ£¬Ëü±¾ÉíÊÇÒ»ÖÖ¶ÔÏóµ¼Ïò£¨Object-Oriented£©µÄ³ÌÐòÓïÑÔ¡£JAVAÄ¿Ç°ÔÚÊÖ»úÉÏÓ¦ÓÃ×î¶àµÄ¾ÍÊÇJAVAÓÎÏ·¡£
JavaÒ²ºÅ³ÆÊÇÄÜ¿çƽ̨ʹÓõÄÓïÑÔ£¬ÕâÖ÷ÒªÊÇÒòΪJava±¾Éí±»±àÒëÖ®ºó£¬²¢² ......
SetºÍÊýѧÖеļ¯ºÏÊÇͬһ¸ö¸ÅÄ¾ÍÊÇûÓÐÖظ´ÔªËصļ¯ºÏ¡£
ÕâƪÎÄÕÂÖ÷ÒªÂÛÊöÁËSetÊÇÈçºÎʵÏÖ"ûÓÐÖظ´ÔªËØ"£¨no duplicate elements£©µÄ£¬ÒÔ¼°²ûÊöÁËʲôÊÇ“Öظ´”£¨duplicate£©£¬ÊÇÏàͬµÄµØÖ·¿Õ¼ä£¿ÊÇequalsµÄ·µ»ØֵΪtrue£¿ÊÇcompareToµÄ·µ»ØֵΪ0 £¿»¹ÊÇÓÐÏàͬµÄhashCode£¿±¾ÎÄ»¹¸ø³öÁËÔÚʲôÇé¿öÏÂʹÓÃʲà ......
BigDecimalÀà
Ë«¾«¶È¸¡µãÐͱäÁ¿double¿ÉÒÔ´¦Àí16λÓÐЧÊý¡£ÔÚʵ¼ÊÓ¦ÓÃÖУ¬ÐèÒª¶Ô¸ü´ó»òÕ߸üСµÄÊý½øÐÐÔËËãºÍ´¦Àí¡£JavaÔÚjava.math°üÖÐÌṩµÄAPIÀàBigDecimal£¬ÓÃÀ´¶Ô³¬¹ý16λÓÐЧλµÄÊý½øÐо«È·µÄÔËËã¡£±í5.7ÖÐÁгöÁËBigDecimalÀàµÄÖ÷Òª¹¹ÔìÆ÷ºÍ·½·¨¡£
±í5.7 BigDecimalÀàµÄÖ÷Òª¹¹ÔìÆ÷ºÍ·½·¨
¹¹ÔìÆ÷ÃèÊö
BigDecimal(in ......
µ¥Àýģʽ£¬¹ËÃû˼Ò壬ֻÄÜÓÐÒ»¸öʵÀý¡£
Ò».´Ó¶àḬ̈߳²È«ËµÆð£¬ÈçÏÂͼ´úÂ룬´ËÎÊÌâ¿ÉÒÔÓÃsynchronized¹Ø¼ü×ÖÀ´½â¾ö¡£¸Ã·½·¨È±µã£ºÃ¿Ò»¸öÏß³ÌÔÚ»ñȡʵÀý¶ÔÏó֮ǰ¶¼ÒªÔÚsynchronizedÉÏͬ²½µÄ¶ÔÏóÉϽøÐеȴý£¬Òò´ËЧÂʲ»¸ß¡£
¶þ.Double Check·½·¨£¬¼ûÏÂͼ´úÂë¡£Double CheckµÄ³õÖÔÊÇÖ»Óе±instanceΪNULLʱִÐеÄÏ̲߳ÅÐèÒªÔÚ ......
ÔÚ±à³ÌµÄʱºò£¬¾³£Óöµ½ÒªÅжÏÒ»¸ö×Ö·û´®ÖеÄ×Ö·ûÊÇ·ñÊÇÊý×Ö(0-9)
ÏÂÃæÎÒ¸ø´ó¼Ò½éÉܼ¸ÖÖʵÏÖ·½·¨
1.ʹÓÃCharacter.isDigit(char)ÅжÏ
String str = "123abc";
if (!"".equals(str)) {
char num[] = str.toCharArray();//°Ñ×Ö·û´®×ª»»Îª×Ö·ûÊý×é
StringBuffer title = new StringBuffer();//ʹÓÃS ......