ÒøÐбÊÊÔÌâ java±ÊÊÔÌâ
ÒøÐбÊÊÔÌâ¼°´ð°¸:java±ÊÊÔÌâ¼°´ð°¸
1¡¢×÷ÓÃÓòpublic,private,protected,ÒÔ¼°²»Ð´Ê±µÄÇø±ð
´ð£º
Çø±ðÈçÏ£º
×÷ÓÃÓò µ±Ç°Àà ͬһpackage ×ÓËïÀà ÆäËûpackage
public √ √ √ √
protected √ √ √ ×
friendly √ √ × ×
private √ × × ×
²»Ð´Ê±Ä¬ÈÏΪfriendly
2¡¢Anonymous Inner Class (ÄäÃûÄÚ²¿Àà) ÊÇ·ñ¿ÉÒÔextends(¼Ì³Ð)ÆäËüÀ࣬ÊÇ·ñ¿ÉÒÔimplements(ʵÏÖ )interfa
Ïà¹ØÎĵµ£º
ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......
Ï̳߳ØÖ÷ÒªÊÇÓÃÀ´ ´¦Àí¶à¸öÇëÇóʱ£¬¼õÉÙ×ÊÔ´ÏûºÄ£¬Ìá¸ßÓ¦ÓÃÐÔÄÜ¡£
ÏÂÃæµÄ´úÂëÊÇÀ´×ÔÓÚ ËïÎÀÇÙ£º<<JavaÍøÂç±à³Ì¾«½â>> ÖÐÏ̳߳ØʵÏÖÔ´Âë, ´úÂë½á¹¹¼òµ¥ÇåÎú£¬¶ÔÓÚÀí½âÏ̳߳أ¬wait(),notify()·½·¨¶¼ÓÐÓÐºÜ ......
import java.util.Random;
/**
* ÅÅÐò²âÊÔÀà
*
* ÅÅÐòËã·¨µÄ·ÖÀàÈçÏ£º
* 1.²åÈëÅÅÐò£¨Ö±½Ó²åÈëÅÅÐò¡¢ÕÛ°ë²åÈëÅÅÐò¡¢Ï£¶ûÅÅÐò£©£»
* 2.½»»»ÅÅÐò£¨Ã°ÅÝÅÝÅÅÐò¡¢¿ìËÙÅÅÐò£©£»
* 3.Ñ¡ÔñÅÅÐò£¨Ö±½ÓÑ¡ÔñÅÅÐò¡¢¶ÑÅÅÐò£©£»
* 4.¹é²¢ÅÅÐò£»
* 5.»ùÊýÅÅÐò¡£
*
& ......
Ò»¡¢JAVAÀ¬»ø»ØÊÕ»úÖƸÅÊö
ÔÚVB¡¢C++µÈijЩ³ÌÐòÉè¼ÆÓïÑÔÖУ¬ÎÞÂÛÊǶÔÏó»¹ÊǶ¯Ì¬ÅäÖõÄ×ÊÔ´»òÄڴ棬¶¼±ØÐëÓɳÌÐòÔ±×ÔÐÐÉùÃ÷²úÉúºÍ»ØÊÕ£¬·ñÔòÆäÖеÄ×ÊÔ´½«²»¶ÏÏûºÄ£¬Ôì³É×ÊÔ´µÄÀË·ÑÉõÖÁËÀ»ú¡£ÓÉÓÚÒªÔ¤ÏÈÈ·¶¨Õ¼ÓõÄÄÚ´æ¿Õ¼äÊÇ·ñÓ¦¸Ã±»»ØÊÕÊǷdz£À§Äѵģ¬Õâ¾Íµ¼ÖÂÊÖ¹¤»ØÊÕÄÚ´æÍùÍùÊÇÒ»ÏÔÓ¶ø¼è¾ÞµÄ¹¤×÷¡£Òò´Ë£¬µ±Ê¹ÓÃÕâЩ³ÌÐ ......
ÓÃJava½Ó¿ÚʵÏֻص÷º¯ÊýµÄµÈ¼Û¹¦ÄÜ
Ê×ÏÈ£¬¿´Ò»Ï»ص÷º¯ÊýµÄ¶¨Òå¼°ÆðÔ´£º
¼ò¶øÑÔÖ®£¬»Øµ÷º¯Êý¾ÍÊÇÒ»¸öͨ¹ýº¯ÊýÖ¸Õëµ÷Óõĺ¯Êý£¬Èç¹ûÄã°Ñº¯ÊýµÄÖ¸Õë(µØÖ·)×÷Ϊ²ÎÊý´«µÝ¸øÁíÒ»¸öº¯Êý£¬µ±Õâ¸öÖ¸Õë±»ÓÃΪµ÷ÓÃËüËùÖ¸ÏòµÄº¯Êýʱ£¬ÎÒÃǾÍ˵Êǻص÷º¯Êý¡£
ΪʲôҪʹÓûص÷º¯Êý£¿
ÒòΪ¿ÉÒ԰ѵ÷ÓÃÕßÓë±»µ÷ÓÃÕß·Ö¿ª¡£µ÷ÓÃÕß²»¹ØÐı» ......