3¡£7³éÏóÀà
¡¡¡¡ÃæÏò¶ÔÏóµÄÒ»¸ö×î´óÓŵã¾ÍÊÇÄܹ»¶¨ÒåÔõÑùʹÓÃÕâ¸öÀà¶ø²»±ØÕæÕý¶¨ÒåºÃ³ÉÔ±º¯Êý¡£Èç¹û³ÌÐòÓɲ»Í¬µÄÓû§ÊµÏÖʱÊǺÜÓÐÓõģ¬Õâ²»ÐèÓû§Ê¹ÓÃÏàͬµÄ³ÉÔ±º¯ÊýÃû¡£
¡¡¡¡ÔÚjavaÀïGraphicsÀàÀïÒ»¸öabstractÀàµÄÀý×ÓÈçÏ£ºpublicabstractclassGraphics£ûpublicabstractvoiddrawLine£¨intx1£»inty1£»intx2£»inty2£©£»publicabstractvoiddrawOval£¨intx£»inty£»intwidth£»intheight£©£»publicabstractvoiddrawRect£¨intx£»inty£»intwidth£»intheight£©£»¡£¡£¡££ý
¡¡¡¡ÔÚGraphicsÀàÀïÉùÃ÷Á˼¸¸ö³ÉÔ±º¯Êý£»µ«³ÉÔ±º¯ÊýµÄʵ¼Ê´úÂëÊÇÔÚÁíÍâÒ»£¿copy£»µØ·½ÊµÏֵġ£
¡¡¡¡publicclassMyClassextendsGraphics£ûpublicvoiddrawLine£¨intx1£»inty1£»intx2£»inty2£©£û£ý£ý
¡¡¡¡µ±Ò»¸öÀà°üº¬Ò»¸öabstract³ÉÔ±º¯Êý£»Õâ¸öÀà±ØÐ붨ÒåΪabstractÀࡣȻ¶ø²¢²»ÊÇabstractÀàµÄËùÓеijÉÔ±º¯Êý¶¼ÊÇabstractµÄ¡£AbstractÀ಻ÄÜÓÐ˽ÓгÉÔ±º¯Êý£¨ËüÃDz»Äܱ»ÊµÏÖ£©£»Ò²²»ÄÜÓо²Ì¬³ÉÔ±º¯Êý¡£
3¡£8½Ó¿Ú
¡¡¡¡µ±ÄãÈ·¶¨¶à¸öÀàµÄ²Ù×÷·½Ê½¶¼ºÜÏàÏóʱ£¬abstract³ÉÔ±º¯ÊýÊǺÜÓÐÓõġ£µ«Èç¹ûÄãÐèҪʹÓÃÕ⣿copy£»abstract³ÉÔ±º¯Êý£¬±ØÐë´´½¨Ò»¸öÐÂÀ࣬ÕâÑùÓÐʱºÜ·±Ëö¡£½Ó¿ÚÌ᣿copy£»ÁËÒ»ÖÖ³éÏó³ÉÔ±º¯ÊýµÄÓÐÀû·½·¨¡£Ò»¸ö½Ó¿Ú°üº¬ÁËÔÚÁíÒ»¸öµØ·½ÊµÏֵijÉÔ±º¯ÊýµÄÊÕ¼¯¡£³ÉÔ±º¯ÊýÔÚ½Ó¿ÚÀﶨÒåΪpublicºÍabstract¡£½Ó¿ÚÀïµÄʵÀý±äÁ¿ÊÇpublic£»staticºÍfinal¡£½Ó¿ÚºÍ³éÏóµÄÖ÷ÒªÇø±ðÊÇÒ»¸ö½Ó¿ÚÌ᣿copy£»ÁË·â×°³ÉÔ±º¯ÊýÐÒéµÄ·½·¨¶ø²»±ØÇ¿ÆÈÓû§¼Ì³ÐÀà¡£Àý×Ó£ºpublicinterfaceAudiClip£û//Startplayingtheclip¡£voidplay£¨£©£»//Playtheclipinaloop¡£voidloop£¨£©£»//Stopplayingtheclipvoidstop£¨£©£»£ý
¡¡¡¡ÏëʹÓÃAudioClip½Ó¿ÚµÄÀàʹÓÃimplenents¹Ø¼ü´ÊÀ´Ì᣿copy£»³ÉÔ±º¯ÊýµÄ³ÌÐò´úÂë¡£classMyClassimplementsAudioClip£ûvoidplay£¨£©£û£ývoidloop£ývoidstop£ý£ý
¡¡¡¡ÓŵãÒ»¸ö½Ó¿ÚÀà¿ÉÒÔ±»ÈÎÒâ¶àµÄÀàʵÏÖ£¬Ã¿¸öÀà¿ÉÒÔ¹²Ïí³ÌÐò½Ó¿Ú¶ø²»±Ø¹ØÐÄÆäËüÀàÊÇÔõÑùʵÏֵġ£classMyOtherClassimplementsAudioClip£ûvoidstop£¨£©£û£ý¡£¡£¡££ýÄÚ²¿³ÉÔ±º¯ÊýJava»¹Ì᣿copy£»Á˵÷ÓÃCºÍC£«£«º¯ÊýµÄ·½·¨¡£ÓÃnative¹Ø¼ü´ÊÀ´¶¨ÒåCºÍC£«£«µÄº¯Êý¡£publicclassDate£ûintnow£»publicDate£¨£©£ûnow=time£¨£©£»£ýprivatenativeinttime£¨£©£»static£ûSystem¡£loadLibrary£¨¡±time¡±£©£»£ý£ýÒ»£¿copy£»Java´úÂëдºÃºó£»¾ÍÐèÒªÒÔϲ½ÖèÖ´ÐУº1¡£ÓÃjavahÀ´´´½¨Í·Îļþ£¨¡£h£©2¡£ÓÃjavahÀ´´´½¨stubÎļþ3¡£ÓÃCºÍC£«£«Ð´native³ÉÔ±º¯ÊýµÄ´úÂë4¡£±àÒëstubÎļþºÍ¡£CÎļþ³ÉÒ»¸ö¶¯Ì¬¿É¼ÓÔØ¿â5¡£ÓÃjavaÔËÐÐjava³ÌÐò»òappletviewerÔËÐÐapplet×¢Ò⣺Native³ÉÔ±º¯Êý³¬³öÁËÀàµÄ·¶Î§¡£
3¡£9°ü£¨Packages£©
¡¡¡¡°ü£¨Package£©ÓÉÒ»×éÀࣨclass£©ºÍ½çÃ棨interface£©×é³É¡£ËüÊǹÜÀí´óÐÍÃû×ֿռ䣬±ÜÃâÃû×Ö³åÍ»µÄ¹¤¾ß¡£Ã¿Ò»¸öÀàºÍ½çÃæµÄÃû×Ö¶¼°üº¬ÔÚij¸ö°üÖС£°´ÕÕÒ»°ãµÄÏ°¹ß£¬ËüµÄÃû×ÖÊÇÓÉ¡±¡£¡±ºÅ·Ö¸ôµÄµ¥´Ê¹¹³É£¬µÚÒ»¸öµ¥´Êͨ³£ÊÇ¿ª·¢Õâ¸ö°üµÄ×éÖ¯µÄÃû³Æ¡£
¡¡¡¡¶¨ÒåÒ»¸ö±àÒëµ¥ÔªµÄ°ü±àÒëµ¥ÔªµÄ°üÓÉpackageÓï¾ä¶¨Òå¡£Èç¹ûʹÓÃpackageÓï¾ä£¬±àÒëµ¥ÔªµÄµÚÒ»ÐбØÐëÎÞ¿Õ¸ñ£¬Ò²ÎÞ×¢ÊÍ¡£Æä¸ñʽÈçÏ£ºpackagepackageName£»Èô±àÒëµ¥ÔªÎÞpackageÓï¾ä£¬Ôò¸Ãµ¥Ôª±»ÖÃÓÚÒ»¸öȱʡµÄÎÞÃûµÄ°üÖС£Ê¹ÓÃÆäËü°üÖеÄÀàºÍ½çÃæÔÚJavaÓïÑÔÀïÌ᣿copy£»Ò»¸ö°ü¿ÉÒÔʹÓÃÁíÒ»¸ö°üÖÐÀàºÍ½çÃæµÄ¶¨ÒåºÍʵÏֵĻúÖÆ¡£ÓÃimport¹Ø¼ü´ÊÀ´±êÃ÷À´×ÔÆäËü°üÖеÄÀà¡£Ò»¸ö±àÒëµ¥Ôª¿ÉÒÔ×Ô¶¯°ÑÖ¸¶¨µÄÀàºÍ½çÃæÊäÈëµ½Ëü×Ô¼ºµÄ°üÖС£ÔÚÒ»¸ö°üÖеĴúÂë¿ÉÒÔÓÐÁ½ÖÖ·½Ê½À´¶¨ÒåÀ´×ÔÆäËü°üÖеÄÀàºÍ½çÃ棺*ÔÚÿ¸öÒýÓõÄÀàºÍ½çÃæÇ°Ãæ¸ø³öËüÃÇËùÔڵİüµÄÃû×Ö£»//ǰ׺°üÃû·¨acme¡£project¡£FooBarobj=newacme¡£project¡£FooBar£¨£©£»*ʹÓÃimportÓï¾ä£¬ÒýÈëÒ»¸öÀà»òÒ»¸ö½çÃ棬»ò°üº¬ËüÃǵİü¡£ÒýÈëµÄÀàºÍ½çÃæµÄÃû×ÖÔÚµ±Ç°µÄÃû×Ö¿Õ¼ä¿ÉÓá£ÒýÈëÒ»¸ö°üʱ£¬Ôò¸Ã°üËùÓеĹ«ÓÐÀàºÍ½çÃæ¾ù¿ÉÓá£ÆäÐÎʽÈçÏ£º//´Óacme¡£projectÒýÈëËùÓÐÀàimportacme¡£project¡£*£»Õâ¸öÓï¾ä±íʾacme¡£projectÖÐËùÓеĹ«ÓÐÀà±»ÒýÈ뵱ǰ°ü¡£ÒÔÏÂÓï¾ä´Óacme¡£project°üÖнøÈëÒ»¸öÀàEmployec_List¡£//´Óacme¡£project¶øÒýÈëEmployee_Listimportacme¡£project¡£Employee_list£»Employee_Listobj=newEmployee_List£¨£©£»ÔÚʹÓÃÒ»¸öÍⲿÀà»ò½çÃæʱ£¬±ØÐëÒªÉùÃ÷¸ÃÀà»ò½çÃæËùÔڵİü£¬·ñÔò»á²úÉú±àÒë´íÎó¡£import£¨ÒýÓã©Àà°ü£¨classpackage£©ÓÃimport¹Ø¼ü´Êµ÷È룻ָ¶¨packageÃû×ÖÈç·¾¶ºÍÀàÃû£»ÓÃ*Æ¥Åä·û¿ÉÒÔµ÷Èë¶àÓÚÒ»¸öÀàÃû¡£
importjava¡£Date£»importjava¡£awt¡£*£»
¡¡¡¡Èç¹ûjavaÔ´Îļþ²»°üº¬package£»Ëü·ÅÔÚȱʡµÄÎÞÃûpackage¡£ÕâÓëÔ´ÎļþͬĿ¼£¬Àà¿ÉÒÔÕâÑùÒýÈ룺importMyClass¡£
¡¡¡¡Javaϵͳ°ü£ºJavaÓïÑÔÌ᣿copy£»ÁËÒ»¸ö°üº¬´°¿Ú¹¤¾ßÏ䣬ʵÓóÌÐò£¬Ò»°ãI/O£»¹¤¾ßºÍÍøÂ繦Äܵİü¡£
¡¡¡¡java¡£appletÕâ¸ö°ü°üº¬Á¿ÁËÒ»£¿copy£»Éè¼ÆappletµÄÀࣻÓÃÒ»¸öÀàAppletºÍÈý¸ö½Ó¿Ú¡£AppletContext£»AppletStub£»ºÍAudioClip¡£
¡¡¡¡java¡£awtÁíÒ»¸ö´°¿Ú¹¤¾ßÏä°ü¡£awt£»°üº¬ÁËÒ»£¿copy£»²úÉú×°ÊÎÎïºÍGUI³ÉÔ±µÄÀà¡£Õâ¸öpackage°üÀ¨£º
¡¡¡¡Button£»Checkbox£»Choice£»ponent£»Graphics£»Menu£»Pane1£»TextAreaºÍTextField¡£
¡¡¡¡java¡£ioI/Opackage°üº¬ÎļþÊäÈë/Êä³öÀ࣬FileInputStreamºÍFileOutputStream¡£
¡¡¡¡java¡£langÕâ¸ö°ü°üº¬JavaÓïÑÔÀࣻ°üº¬£º¶ÔÏó£»Ị̈߳»Òì³£³ö¿Ú£»ÏµÍ³£»ÕûÊý£»Ôµã£»Êýѧ£»×Ö·ûµÈ¡£
¡¡¡¡javaÕâ¸öÀàÖ§³ÖTCP/IPÍøÂçÐÒ飬²¢°üº¬SocketÀࣻURLºÍURLÏàÁªÏµµÄÀà¡£
¡¡¡¡java¡£utilÕâ¸öÀà°üº¬Ò»£¿copy£»³ÌÐòµÄͬ²½ÀࣻËü°üº¬Date£»DictionaryÀàµÈ¡£
3¡£10Òì³£
¡¡¡¡µ±ÔÚJava³ÌÐòÖз¢ÉúÒ»¸ö´íÎóʱ£¬ÀýÈ磺һ¸ö±äÔªµÄÖµ·Ç·¨£¬´úÂë»á·¢ÏÖÕâ¸ö´íÎ󣬲¢Òý·¢Ò»¸öÒì³££¨exception£©¡£ÔÚȱʡµÄÇé¿öÏ£¬Òì³£»áÊä³öÒ»¸ö´íÎóÏûÏ¢£¬È»ºóÖÐÖ¹Ï̵߳ÄÖ´ÐС£µ«ÊÇ£¬³ÌÐò×Ô¼º¿ÉÒÔ¶¨ÒåÒì³£´¦Àí¶Î£¨exceptionhandler£©À´½Ø»ñ£¨catch£©Òì³££¬²¢´Ó´íÎóÖлָ´¡£ÓÐÒ»£¿copy£»Òì³£ÊÇÓÉJava½âÊÍÆ÷ÔÚÔËÐÐʱ¿ÌÒý·¢µÄ¡£Êµ¼ÊÉÏ£¬ÈκÎÀ඼¿ÉÒÔ¶¨ÒåÊôÓÚ×Ô¼ºµÄÒì³££¬²¢Ê¹ÓÃthrowÓï¾äÒý·¢ËüÃÇ¡£Ò»¸öthrow£¨Òý·¢£¿copy£»Óï¾äÊÇÓÉthrow¹Ø¼ü×ÖºÍÒ»¸ö¶ÔÏ󹹳ɡ£°´³£¹æ£¬¸Ã¶ÔÏóÓ¦¸ÃÊÇExceptionÀàµÄʵÀý»òÆä×ÓÀàµÄʵÀý¡£throwÓï¾ä»áÒýÆðÖ´ÐÐתÏòÏàÓ¦µÄÒì³£´¦Àí¶Î¡£µ±Ò»¸öthrowÓï¾äÖ´ÐÐʱ£¬ËüÏÂÃæµÄËùÓдúÂë²»ÔÙÖ´ÐÐÁË£¬ËüËùÔڵķ½·¨Ò²²»ÔÙ·µ»ØÖµ¡£ÏÂÃæµÄÀý×Ó½«ÑÝʾÈçºÎ´´½¨Ò»¸öExceptionµÄ×ÓÀ࣬ȻºóÒý·¢Ò»¸öÒì³£¡£classMyExceptionextendsException£û£ýclassMyClass£ûvoidoops£¨£©£ûif£¨/*²»³öÏÖ´íÎó*/£©£û¡£ýelse£û/*³ö´í*/£ýelse£û/*³ö´í*/thrownewMyException£¨£©£»£ý£ý£ýΪÁ˶¨ÒåÒ»¸öÒì³£´¦Àí¶Î£¬³ÌÐò±ØÐëÓÃtryÓï¾ä°Ñ¿ÉÄܲúÉúÒì³£µÄ´úÂë³É×é¡£ÔÚtryÓï¾äºóÃæ¸úÉÏÒ»¸ö»ò¶à¸öcatch£¨½Ø»ñ£¿copy£»Óï¾ä£¬Ã¿¸öÒì³£¶ÔÓ¦Ò»¸öcatchÓï¾ä¡£Ã¿¸öcatchÓï¾äÖаüº¬×ÅÒì³£´¦Àí¶Î¡£ÀýÈ磺try£ûp¡£a=10£»£ýcatch£¨NullPointerExceptione£©£ûprintln£¨¡±pwasnull¡±£©£»£ýcatch£¨Exceptione£©£ûprintln£¨¡±othererrorsoccured¡±£©£»£ýcatch£¨Objectobj£©£ûprintln£¨¡±Whothrewthatobject£¿¡±£©£»£ýcatchÓï¾äºÍÒ»¸ö·½·¨¶¨ÒåÀàËÆ£¬Ö»²»¹ý¸Ã·½·¨Ö»ÓÐÒ»¸ö²ÎÊý£¬ÇÒÎÞ·µ»ØÀàÐÍ¡£²ÎÊý¿ÉÒÔÊÇÒ»¸öÀà»òÒ»¸ö½çÃæ¡£µ±Ò»¸öÒì³£·¢Éúʱ£¬Ç¶Ì×µÄtry/catchÓï¾ä»áÑ°ÕÒ³öÓë¸ÃÒì³£ÀàÏàÆ¥ÅäµÄ²ÎÊý¡£Èç¹ûÒ»¸ö²ÎÊýºÍÖ¸¶¨Ò쳣ƥÅäÔò£º*¸Ã²ÎÊýºÍÖ¸¶¨µÄÒì³£ÊÇͬһ¸öÀ࣬»ò*¸Ã²ÎÊýÊÇÖ¸¶¨Òì³£µÄ×ÓÀ࣬»ò*Èç¹û²ÎÊýÊÇÒ»¸ö½çÃ棬ָ¶¨Òì³£ÀàʵÏÖÁËÕâ¸ö½çÃæ¡£µÚÒ»¸ö²ÎÊýºÍÒ쳣ƥÅäµÄtry/catchÓï¾ä£¬ÔòÓëÆäÆ¥ÅäµÄcatchÓï¾äÖ´ÐС£ÔÚcatchÓï¾äÖ´ÐÐÍêºó£¬³ÌÐòµÄÖ´Ðб»»Ö¸´¡£µ«ÒѲ»¿ÉÄָܻ´µ½Òì³£·¢Éú´¦ÔÙ´ÎÖ´ÐС£ÀýÈ磺print£¨¡±now¡±£©£»try£ûprint£¨¡±is¡±£©£»thrownewMyException£¨£©£»print£¨¡±a¡±£©£»£ýcatch£¨MyExceptione£©£ûprint£¨¡±the¡±£©£»£ýprint£¨¡±timen¡±£©£»´òӡΪ¡±nowisthetime¡±¡£ÕýÈçÕâ¸öÀý×ÓËùʾ£¬Òì³£Ó¦¸ÃÖ÷ÒªÓÃÓÚ´íÎó´¦Àí£¬ÈôÓÃÓÚÆäËü·½Ãæ»áʹ´úÂë»ÞɬÄÑ£¿reg£»¡£Òì³£´¦Àí¶ÎÊÇ¿ÉÒÔǶÌ׵ģ¬ÔÊÐíÒì³£´¦Àí¿ÉÒÔ·¢ÉúÔÚ¶à¸öµØ·½¡£Ç¶Ì×Òì³£´¦Àíͨ³£ÓÃÓÚµ±µÚÒ»¸ö´¦Àí³ÌÐòÎÞ·¨ÍêÈ«´Ó´íÎóÖлָ´¹ýÀ´µÄʱºò£¬¶ø²»µÃ²»Ö´ÐÐÒ»£¿copy£»Çå³ý´úÂ롣ΪÁË°ÑÒì³£´¦Àí¿ØÖÆ´«µÝ¸ø¸ü¸ß²ãµÄ´¦Àí¶Î£¬¿ÉÒÔÔÙÒ»´Î¶Ô½Ø»ñ¶ÔÏóʵ£¿copy£»throw²Ù×÷¡£×¢ÒªÔÙ´ÎʵthrowÒì³£µÄ·½·¨£¬throwÓï¾äÖ´ÐÐÍêºó£¬»áÖÕÖ¹Ö´ÐС£try£ûf¡£open£¨£©£»£ýcatch£¨Exceptione£©£ûf¡£close£¨£©£»throwe£»£ý¶¨¾ÖÓï¾äfinally£¨¶¨¾Ö£¿copy£»Óï¾äÊÇÓÃÓÚ±£Ö¤ÎÞÂÛÔÚÒì³£ÊÇ·ñ·¢ÉúµÄÇé¿öÏ£¬Ä³£¿copy£»´úÂë±»Ö´ÐС£ÏÂÀý˵Ã÷finallyÓï¾äµÄÓ÷¨£ºtry£û//×öij£¿copy£»¶¯×÷£»£ýfinally£û//´ËºóÇå³ý£»£ýºÍÒÔÏ´úÂëÀàËÆtry£û//×öij£¿copy£»¶¯×÷£ýcatch£¨Objecte£©£û//´ËºóÇå³ý£»throwe£»£ý£ý//´ËºóÇå³ý£»¼´Ê¹try¿éÖаüº¬return£¬break£¬continue£¬throwÓï¾ä£¬finallyÓï¾äÒ²»á±»Ö´ÐС£ÀýÈ磺ÏÂÃæµÄ´úÂ롱finally¡±×ÜÊDZ»Êä³ö£¬¶ø¡±aftertry¡±½öÔÚa£¡=10ʱ±»Êä³ö¡£try£ûif£¨a==10£©£ûreturn£»£ý£ýfinally£ûprint£¨¡±finallyn¡±£©£»£ýprint£¨¡±aftertryn¡±£©£»ÔËÐÐʱ¿ÌÒì³£±¾½ÚÁгöµÄÇåµ¥ÊÇJava½âÊÍÆ÷Òý·¢µÄ¸÷ÖÖÒì³£¡£µ±ÔËÐÐʱ¿Ì·¢ÏÖ¸÷ÖÖ´íÎó£¬ÓɽâÊÍÆ÷Òý·¢Òì³£¡£ArithmeticExceptionÈç¹û³ÌÐòÊÔͼ³ý0£¬»òÓÃ0È¡Ä££¬»á²úÉúArithmeticException£¨ËãÊõÒì³££¿copy£»£¬ÆäËüËãÊõ²Ù×÷²»»á²úÉúÒì³£¡£ÓйØJavaÈçºÎ´¦ÀíÆäËüËãÊõ´íÎóµÄÐÅÏ¢£¬¼û¡±ÕûÊýÔËËã·û¡±ºÍ¡±¸¡µãÔËËã·û¡±Á½½Ú¡£ÀýÈ磺ÏÂÃæµÄ´úÂ뽫»áÒý·¢ArithmeticExceptionÒì³££ºclassArith£ûpublicstaticvoidmain£¨Stringargs£§£§£©£ûintj=0£»j=j/j£»£ý£ýNullPointerExceptionµ±³ÌÐòÊÔͼ·ÃÎÊÒ»¸ö¿Õ¶ÔÏóÖеıäÁ¿»ò·½·¨£¬»òÒ»¸ö¿ÕÊý×éÖеÄÔªËØʱÔòÒý·¢NullPointerException£¨¿ÕÖ¸ÕëÒì³££¿copy£»¡£ÀýÈ磬·ÃÎʳ¤¶ÈΪ0µÄÊý×éa£§0£§¡£ÓÐÒÔÏÂÀàÉùÃ÷£¬ÔËÐÐʱ»áÒý·¢NullPointerExceptionÒì³££ºclassNull£ûpublicstaticvoidmain£¨Stringargs£§£§£©£ûStringo=null£»inta£§£§=null£»o¡£length£¨£©£»a£§0£§=0£»£ý£ýÓÐȤµÄÊÇ£¬Èç¹ûÎÒÃÇÒý·¢Ò»¸ö¿Õ¶ÔÏó£¬Ò²»á²úÒ»NullPointerExceptionÒì³£¡£InpatibleClassChangeExceptionµ±Ò»¸öÀàµÄ¶¨Òå±»¸Ä±ä£¬¶øÒýÓøÃÀàµÄÆäËüÀàûÓб»ÖØбàÒëʱ£¬»á²úÉúÕâÒ»Òì³£¡£ÓÐËÄÖÖÀà¸ü¸Ä»áµ¼ÖÂÔËÐÐʱ¿ÌÒý·¢InpatibleClassChangExceptionÒì³£¡£*Ò»¸öÀàÖеıäÁ¿ÉùÃ÷ÓÉstatic±ä³É·Çstatic£¬¶øÆäËü·ÃÎʸÃÀàÕâÒ»±äÁ¿µÄÀàûÓб»ÖØбàÒë¡£*Ò»¸öÀàÖеıäÁ¿ÉùÃ÷ÓÉ·Çstatic±ä³Éstatic£¬¶øÆäËü·ÃÎʸÃÀàÕâÒ»±äÁ¿µÄÀàûÓб»ÖØбàÒë¡£*ÀàÖÐÉùÃ÷µÄij¸öÓò±»É¾³ý£¬¶øÆäËü·ÃÎʸÃÓòµÄÀàûÓб»ÖØбàÒë¡£*ÀàÖÐÉùÃ÷µÄij¸ö·½·¨±»É¾³ý£¬¶øÆäËü·ÃÎʸ÷½·¨µÄÀàûÓб»ÖØбàÒë¡£
¡¡¡¡ClassCastExceptionÈç¹ûÊÔͼ°Ñ¶ÔÏóoÇ¿ÖƳÉClassC£¬¶øo¼È²»ÊÇClassCµÄʵÀý£¬Ò²²»ÊÇClassC×ÓÀàµÄʵÀý£¬Õâʱ±ã»á²úÉúClassCastException¡£classClassCast£ûpublicstaticvoidmain£¨Stringargs£§£§£©£ûObjecto=newObject£¨£©£»Strings=£¨string£©o£»s¡£length£¨£©£»£ý£ý£ýNagativeArraySizeExceptionÈç¹ûÒ»¸öÊý×éµÄ³¤¶ÈÊǸºÊý£¬Ôò»áÒý·¢NagativeArraySizeException£¨Êý×鸺ϱꣿcopy£»Òì³£¡£ÀýÈçÏÂÃæÀඨÒåµÄ´úÂëÔÚÔËÐÐʱÒý·¢ÕâÒ»Òì³££ºclassNegArray£ûpublicstaticvoidmain£¨Stringargs£§£§£©£ûinta£§£§=newint£§¡1£§£»a£§0£§=0£»£ý£ý
¡¡¡¡OutOfMemoryExceptionµ±ÏµÍ³ÎÞ·¨ÔÙÏòÓ¦ÓóÌÐòÌ᣿copy£»ÄÚ´æʱ£¬»áÒý·¢OutOfMemoryException£¨ÄÚ´æÒç³ö£¿copy£»Òì³£¡£ÕâÖÖÒì³£Ö»ÄܳöÏÖÔÚ´´½¨Ð¶ÔÏóµÄʱºò£¬¼´new±»µ÷ÓõÄʱºò¡£ÀýÈ磬ÏÂÃæÒ»¶Î´úÂëÔÚÔËÐÐʱ¿Ì»áÒý·¢OutOfMemoryExceptionÒì³££ºclassLink£ûinta£§£§=newint£§1000000£§£»Linkl£»£ýClassOutOfMem
£ûpublicstaticvoidmain£¨Stringargs£§£§£©£ûpublicstaticvoidmain£¨Stringargs£§£§£©£ûLinkroot=newlink£¨£©£»Linkcur=root£»while£¨true£©£ûcur¡£l=newLink£¨£©£»cur=cur¡£l£»£ý£ý£ýNoClassDefFoundExceptionÈç¹ûÒ»¸öÀà±»ÒýÓ㬵«ÔÚÔËÐÐʱ¿Ì£¬ÏµÍ³Ã»ÓÐÕÒµ½±»ÒýÓõÄÀ࣬Õâʱ»áÒý·¢NoClassDefFoundException£¨Î´ÕÒµ½ÀඨÒ壿copy£»Òì³£¡£ÀýÈ磬NoClass
µÄÉùÃ÷ÈçÏ£ºclassNoClass£ûpublicstaticvoidmain£¨Stringargs£§£§£©£ûCc=newC£¨£©£»£ý£ýµ±NoClassÔËÐÐʱ£¬Èç¹û½âÊÍÆ÷ÕÒ²»µ½CÀ࣬Ôò»