ΪʲôJAVAҪʹÓõ¥¼Ì³ÐÌåϵ
´ó¼Ò¶¼ÖªµÀJAVAÖÐʹÓÃOBJECT×÷ΪΨһµÄ»ùÀà¡£µ«ÊÇJAVAµÄÉè¼ÆÕßΪʲôҪÕâÑù×öÄØ£¿ÖضÁ¡¶TTHINKING IN JAVA¡·£¬µÃ³öÒÔÏÂÔÒò£º
1£¬JAVAÊÇ´¿ÃæÏò¶ÔÏóµÄÓïÑÔ¡£µ¥¼Ì³ÐÌåϵ±£Ö¤ÁËËùÓÐн¨µÄ»òJDKÖÐÒÑÓеÄÀ඼±ØÐë¼Ì³Ð×ÔOBJECT¡£ÕâÑù£¬±£Ö¤ÁËËùÓеÄÀ඼¾ßÓÐһЩ»ù±¾µÄ·½·¨¡£ÀýÈçÒ»¸öString¶ÔÏóÓÐtoString()·½·¨£¬ÁíÍâÒ»¸öMath¶ÔÏóÒ²ÓÐÕâ¸ö·½·¨£¬²»ÐèҪΪÿ¸ö¶ÔÏó¶¼È¥Ð´Ò»¸öÕâÑùµÄ·½·¨¡£
2£¬javaÖÐÓиöÀ¬»ø»ØÊÕÆ÷»úÖÆ£¬µ±Ò»¸ö¶ÔÏó²»ÔÙ±»ÐèҪʱ£¬ÓÉÀ¬»ø»ØÊÕÆ÷»ØÊÕ²¢Ïú»ÙÕâ¸ö¶ÔÏó£¬ÊÍ·ÅËüÕ¼ÓõÄÄÚ´æ¿Õ¼ä¡£¶øµ¥¼Ì³ÐÌåϵÈÃÀ¬»ø»ØÊÕÆ÷µÄʵÏÖ±äµÃ¼òµ¥¶àÁË¡£ÕâÔµÓÚÿ¸ö¶ÔÏ󶼾ßÓдÓOBJECT¼Ì³Ð¶øÀ´µÄfinalize
()
·½·¨¡£
3£¬OBJECTÖÐÓиögetClass()·½·¨£¬µÃµ½¶ÔÏóµÄÔËÐÐʱÀà¡£ÕâÑù¾Í±£Ö¤ÁËÿ¸öJAVA¶ÔÏó¶¼ÔÚÔËÐÐʱ¾ßÓÐÒ»¸öÔËÐÐʱÀàµÄÐÅÏ¢¡£
4£¬ÓÐÀûÓÚÈÝÆ÷µÄ¸´Óá£JAVAÉè¼ÆÈÃÈÝÆ÷¿ÉÒÔ´æ´¢OBJECT£¬ÕâÒ²¾ÍÒâζ×Å¿ÉÒÔ´æ´¢ÆäËüÈκÎÀàÐÍ¡£µ±È»£¬Éæ¼°µ½ÈÝÆ÷´æ´¢£¬Óиö¶ÔÏóµÄÏòÉÏתÐͺÍÏòÏÂתÐÍ¡£¾ßÌå¹ý³ÌÊÇÕâÑùµÄ£ºÎÒÃÇ·ÅÈëÈÝÆ÷Öеģ¬ÆäʵÊǶÔÏóµÄÒýÓ㬵«ÊÇÓÉÓÚÈÝÆ÷Ö»´æ´¢OBJECT¶ÔÏó£¬ËùÒÔËùÓеĶÔÏóÒýÓö¼Òª±»ÏòÉÏתÐÍΪOBJECT£¬µ«ÊÇÔÚ´ÓÈÝÆ÷ÖÐÈ¡³ö¶ÔÏóµÄʱºò£¬Ëù»ñÈ¡µ½µÄ£¬ÆäʵÊǶÔÒ»¸öOBJECT¶ÔÏóµÄÒýÓ㬶ø²»ÊÇ·ÅÈëµÄʱºòµÄÄǸöÀàÐ͵ĶÔÏóµÄÒýÓã¬Õâʱºò£¬¾Í±ØÐëÓõ½ÏòÏÂתÐÍ¡£¶øÏòÏÂתÐÍÊÇÎÞ·¨±£Ö¤°²È«µÄ£¬ÕâÀï¾ÍÓõ½ÁË·ºÐ͵ĸÅÄî¡£ÕâÒ²ÊÇJDK5µÄÐÂÌØÐÔÖ®Ò»¡£
5£¬OBJECTÌṩÁËÆäËü±ãÀûºÍ³£Óõķ½·¨£¬Èçclone()¡£
ÔÝʱֻÏëµ½Õâô¶à¡£
Ïà¹ØÎĵµ£º
Java ÀíÂÛÓëʵ¼ù: Ãè»æḬ̈߳²È«ÐÔ
2007-12-15 00:10
——Ḭ̈߳²È«²»ÊÇÒ»¸ö·ÇÕæ¼´¼ÙµÄÃüÌâ
Brian Goetz (brian@quiotix.com), Ê×ϯ¹ËÎÊ, Quiotix Corp
2003 Äê 11 ÔÂ 15 ÈÕ
7Ô·ÝÎÒÃǵIJ¢·¢×¨¼Ò Brian Goetz ½« Hashtable ºÍ Vector ÀàÃèÊöΪ“ÓÐÌõ¼þḬ̈߳²È«µÄ”¡£Ò»¸öÀàÄѵÀ²»ÊÇḬ̈߳²È«¾ÍÊÇÏß³Ì ......
֮ǰÔÚ×öfindbugsµÄʱºò¾³£»á²é¿´×Ö½ÚÂ룬¶¼ÊÇÒ»Öª°ë½âµÄ
ÄÇÌì¿´µ½Ò»¸öÎÊÌ⣬¸ÕºÃ¿ÉÒÔ´Ó×Ö½ÚÂëÀ´½âÊÍ
ÕâЩÌâÄ¿³£¼ûÓÚÃæÊÔÌ⣬ͨ³£ÒªÊÇ˸ÒÕâôд´úÂ룬ÍêÈ«ÊÇÔÚÕÒËÀ¡£¡£
Java´úÂë
public class Test {
public static void main(String[]  ......
Õâ¸ö¿ò¼ÜÒ²ÊÇΪgoogle app engine×¼±¸µÄ¡£µ±Ê±¸Ð¾õÖ±½ÓÔÚgaeÉÏsevletÌ«·³ÈËÁË£¬¾Í·â×°¸ö¼òÒ׵Ŀò¼Ü¡£Ê¹ÓõÄʱºòÖ»ÐèÒªÅäÖÃweb.xmlÖÐDispacherSevletºÍpackage.propertiesÖеÄpackage.path£¨Ä¬ÈÏɨÃèµÄ°ü£©¼´¿É
gaeÀý×Ó£ºhttp://orzblogs.appspot.com/Home.htm
´óѧµÄʱºòºÜBS java£¬Ñ§ÁËÖ®ºó¾ÍÈÓµôÁË£¬ÏÖÔÚ¹¤×÷Á˲ſªÊ¼ ......
ÔÚJavaÓ¦ÓÃÖУ¬ÈÕÆÚºÍʱ¼ä×÷Ϊ»ù±¾µÄÐÅÏ¢ÀàÐÍÓ¦ÓõÄÌرð¹ã·º£¬ÀýÈç»ñÈ¡µ±Ç°Ê±¼ä£¬¼ÆËãijЩ²Ù×÷Ö´ÐеÄʱ¼äµÈ¡£ÈÕÆÚ´¦ÀíÏà¹ØµÄÀà°üÀ¨DateºÍCalendar£¬Í¨¹ýDateºÍCalendar¿ÉÒÔ»ñÈ¡µ±Ç°Ê±¼ä£¬¶Ôʱ¼ä½øÐÐһЩÔËË㣬»ñȡʱ¼äÖеÄÄê¡¢Ô¡¢ÈÕ¡¢Ê±¡¢·Ö¡¢ÃëºÍÐÇÆÚµÈÐÅÏ¢¡£ÔÚÊäÈëºÍÊä³öµÄʱºò¾³£Óõ½×Ö·û´®ÐÎʽµÄʱ¼ä£¬Õâ¾ÍÐèҪʱ¼äºÍ ......
ÔÚ×öweb¿ª·¢µÄʱºò£¬¾³£ÐèÒªÔÚÒ»¶¨µÄʱ¼äÈ¥¸úÐÂijЩ¶«Î÷£¬»òÊǼÓÔØijЩ¶«Î÷£¬Õâ¾ÍÓõ½Á˶¨Ê±Æ÷¡£
µ±Web¹¤³ÌÆô¶¯Ê±£¬¶¨Ê±Æ÷ÄÜ×Ô¶¯¿ªÊ¼¼Æʱ£¬ÔÚÕû¸öWeb¹¤³ÌµÄÉúÃüÆÚÀ¶¨Ê±Æ÷ÿ¹ýÒ»¶Îʱ¼ä¾ÍÖ´ÐÐÒ»´Î£¬ËùÒÔ¿¼ÂǶ¨Ê±Æ÷´æ·ÅµÄλÖá£
¶¨Ê±Æ÷¿Ï¶¨²»Äܲ»Äܼòµ¥µÄ´æÔÚÓÚµ¥¸öServlet»òJavaBeanÖУ¬±ØÐëÄ ......