ä¸æ¯çåï¼ä¹å¯ä»¥æ¯private çï¼ä½¿ç¨private æ¶ï¼å¤ç¨æ¥å®ç°åä¾æ¨¡å¼ã
ä¹ä¸æ¯static çï¼æé æ¹æ³æjava èææºè°ç¨ã
------解å³æ¹æ¡--------------------------------------------------------
å°æé æ¹æ³è®¾å®ä¸ºpublicï¼åªæ¯ä¸ºäºéå¶å¯¹è±¡çå®ä¾åï¼æ¯ä¸ºäºå±è½æå¤é¨éè¿new å®ä¾å½å对象ã
------解å³æ¹æ¡--------------------------------------------------------
æé æ¹æ³æä»çä½ç¨ã
ä¹æstatic çãç¨æ³ä¸åã
------解å³æ¹æ¡--------------------------------------------------------
æé æ¹æ³å¯ä»¥ç¨ publicãprivateãprotected 修饰ï¼ä½ä¸è½ç¨ staticï¼å 为æé æ¹æ³æ¯ç±»
å建å®ä¾æ¶ï¼èªå¨è°ç¨çï¼è¥æé æ¹æ³å®ä¹ä¸ºç§æï¼ä¾¿ä¸è½æ继æ¿åç±»ï¼å 为å类使ç¨ç¶ç±»æé æ¹æ³
------解å³æ¹æ¡--------------------------------------------------------
å个ä½ç¨åé½å¯ä»¥æçã
publicï¼å¤é¨å¯ä»¥èªç±è®¿é®
privateï¼å¨åä¾æ¨¡å¼ä¸ä½¿ç¨ï¼å³å¯¹å¤å¼æ¾build æ¥å£
------解å³æ¹æ¡--------------------------------------------------------
ä¸å声æç±»ç访é®æéï¼
1.public: åä¸ä¸ªç±» åä¸ä¸ªå
åç±» å
¶ä»å
ä¸çç±»
2.protected: åä¸ä¸ªç±» åä¸ä¸ªå
åç±»
3.private: åä¸ä¸ªç±»
è³äºä½ 说çstaticï¼è¿ä¸ªæ¯ç¨æ¥å£°æéæç±»çï¼ä¹å°±æ¯è¯´ä¸ç¨å®ä¾å类就å¯ä»¥ä½¿ç¨ï¼ä¸è¬ç¨
äºä¿®é¥°éæåéåéææ¹æ³ã
温馨提示:答案为网友推荐,仅供参考