ºÓ±±¹¤Òµ´óѧ³ÇÊÐѧԺ2010¼¶ÍøÂç±à³Ì¼¼ÊõÊÔÑéÖ¸µ¼Êé
¹²51Ò³£¬µÚ13Ò³
ºÓ±±¹¤Òµ´óѧ³ÇÊÐѧԺ2010¼¶ÍøÂç±à³Ì¼¼ÊõÊÔÑéÖ¸µ¼Êé
2¡¢±àÒë²¢ÔËÐÐÏÂÃæµÄ³ÌÐò£¬·ÖÎöÔËÐнá¹û£¬Ìå»áÆäÖз½·¨ÖØÔصÄÓ÷¨£¬½øÒ»²½Àí½â·½·¨ÖØÔصĸÅÄî¡£
Èý¡¢½Ó¿ÚµÄ¶¨ÒåºÍʹÓÃ
1¡¢½Ó¿ÚµÄ»ù±¾¸ÅÄî
JavaÖеĽӿÚÔÚÓï·¨ÉÏÓÐЩÀàËÆÓÚÀ࣬Ëü¶¨ÒåÁËÈô¸ÉµÄ³éÏó·½·¨ºÍ³£Á¿£¬ÐγÉÒ»¸öÊôÐÔ¼¯ºÏ£¬¸ÃÊôÐÔ¼¯ºÏͨ³£´ú±íÁËijһ¹¦ÄܵÄʵÏÖ¡£ËüµÄÖ÷Òª×÷ÓÃÊÇ¿ÉÒÔ°ïÖúÎÒÃÇʵÏÖÀàËÆÓÚÀàµÄ¶àÖؼ̳еŦÄÜ¡£
JavaÖи÷Àà»ñȡijһ½Ó¿Ú¶¨ÒåµÄ¹¦ÄÜ£¬²¢²»ÊÇͨ¹ýÖ±½Ó¼Ì³ÐÕâ¸ö½Ó¿ÚÖеÄÓòºÍ·½·¨À´ÊµÏֵģ¬ÒòΪ½Ó¿ÚÖеÄÓò¶¼Êdz£Á¿£¬½Ó¿ÚÖеķ½·¨¶¼ÊÇûÓз½·¨ÌåµÄ³éÏó·½·¨£¬Ò²¾ÍÊÇ˵£¬½Ó¿Ú¶¨ÒåµÄ½ö½öÊÇʵÏÖijһÌض¨¹¦ÄܵŦÄܽӿں͹淶£¬¶ø²¢Ã»ÓÐÕæÕýµÄʵÏÖÕâ¸ö¹¦ÄÜ£¬Õâ¸ö¹¦ÄܵÄÕæÕýʵÏÖʵÔÚ¡°¼Ì³Ð¡±ÁËÕâ¸ö½Ó¿ÚµÄ¸÷¸öÀàÖÐÍê³ÉµÄ£¬ÓÐÕâЩÀàÀ´¾ßÌ嶨Òå½Ó¿ÚÖи÷³éÏó·½·¨µÄ·½·¨Ìå¡£¹ÊÔÚJavaÖУ¬Í¨³£°Ñ¶Ô½Ó¿Ú¹¦Äܵġ°¼Ì³Ð¡±³ÆΪʵÏÖ¡£ 2¡¢½Ó¿ÚµÄÉùÃ÷
JavaÖÐÉùÃ÷½Ó¿ÚµÄÓï·¨ÈçÏ£º
[public] interface ½Ó¿ÚÃû [extends ¸¸½Ó¿ÚÃûÁбí]
¹²51Ò³£¬µÚ14Ò³
ºÓ±±¹¤Òµ´óѧ³ÇÊÐѧԺ2010¼¶ÍøÂç±à³Ì¼¼ÊõÊÔÑéÖ¸µ¼Êé
{ //½Ó¿ÚÌ壺
// ³£Á¿ÓòÉùÃ÷
[public] [static] [final] ÓòÀàÐÍ ÓòÃû=³£Á¿Öµ£» // ³éÏó·½·¨ÉùÃ÷
[public] [abstract] [native] ·µ»ØÖµ ·½·¨Ãû£¨²ÎÊýÁÐ±í£©[throw Òì³£Áбí]£» }
3¡¢½Ó¿ÚµÄʵÏÖ
ij¸öÀàΪ½Ó¿ÚÖеijéÏó·½·¨ÊéдÓï¾ä²¢¶¨ÒåʵÔڵķ½·¨Ì壬³ÆΪ¸ÃÀàʵÏÖ¿ÉÕâ¸ö½Ó¿Ú¡£Ê¾ÀýÈçÏ£º
±àÒë²¢ÔËÐÐÉÏÊö³ÌÐò£¬·ÖÎö³ÌÐòµÄÔËÐнá¹û¡£ ËÄ¡¢°üµÄ¶¨ÒåºÍʹÓÃ
? ´´½¨×Ô¶¨Òå°üMypackage
ÔÚ´æ·ÅÔ´³ÌÐòµÄÎļþ¼ÐÖн¨Á¢Ò»¸ö×ÓÎļþ¼Ð Mypackage¡£ÀýÈ磬ÔÚ¡°E:\\java\\
¹²51Ò³£¬µÚ15Ò³
ºÓ±±¹¤Òµ´óѧ³ÇÊÐѧԺ2010¼¶ÍøÂç±à³Ì¼¼ÊõÊÔÑéÖ¸µ¼Êé
³ÌÐò¡±Îļþ¼ÐÖ®Öд´½¨Ò»¸öÓë°üͬÃûµÄ×ÓÎļþ¼Ð Mypackage£¨E:\\java\\³ÌÐò\\Mypackage£©£¬²¢½«±àÒë¹ýµÄ class Îļþ·ÅÈë¸ÃÎļþ¼ÐÖС£×¢Ò⣺°üÃûÓëÎļþ¼ÐÃû´óСдҪһÖ¡£ÔÙÌí¼Ó»·¾³±äÁ¿ classpath µÄ·¾¶£¬ÀýÈ磺E:\\j2sdk1.4.2_01\\lib; E:\\java\\³ÌÐò ? ÔÚ°üÖд´½¨Àà
YMD.java ³ÌÐò¹¦ÄÜ£ºÔÚÔ´³ÌÐòÖУ¬Ê×ÏÈÉùÃ÷ʹÓõİüÃûMypackage£¬È»ºó´´½¨YMD À࣬¸ÃÀà¾ßÓмÆËã½ñÄêµÄÄê·Ý²¢Êä³öÒ»¸ö´øÓÐÄêÔÂÈÕµÄ×Ö·û´®µÄ¹¦ÄÜ¡£Ô´´úÂëÈçÏÂ
±àÒëTest_YMD.javaÎļþ£¬È»ºó½«Test_YMD.classÎļþ´æ·Åµ½MypackageÎļþ¼ÐÖС£
? ±àдʹÓðüMypackageÖÐTest_YMDÀàµÄ³ÌÐò
YMD_2.java³ÌÐò¹¦ÄÜ£º¸ø¶¨Ä³ÈËÐÕÃûÓë³öÉúÈÕÆÚ£¬¼ÆËã¸ÃÈËÄêÁ䣬²¢Êä³ö¸ÃÈËÐÕÃû£¬ÄêÁ䣬³öÉúÈÕÆÚ¡£³ÌÐòʹÓÃÁËTest_YMD µÄ·½·¨À´¼ÆËãÄêÁä¡£Ô´´ú
¹²51Ò³£¬µÚ16Ò³