1ãåè½åä½ç¨çä¸å
æé å¨æ¯ä¸ºäºå建ä¸ä¸ªç±»çå®ä¾ã
2ã修饰符ï¼è¿åå¼åå½åçä¸å
æé å¨åæ¹æ³å¨ä¸é¢ä¸ä¸ªæ¹ä¾¿çåºå«ï¼ä¿®é¥°ç¬¦ï¼è¿åå¼ï¼å½åãåæ¹æ³ä¸æ ·ï¼æé å¨å¯ä»¥æä»»ä½è®¿é®çä¿®é¥°ï¼ public, protected, privateæè
没æ修饰ï¼é常被package å friendlyè°ç¨ï¼. ä¸åäºæ¹æ³çæ¯ï¼æé å¨ä¸è½æ以ä¸é访é®æ§è´¨çä¿®é¥°ï¼ abstract, final, native, static, æè
synchronizedã
3ãè¿åç±»åä¹æ¯é常éè¦çã
æ¹æ³è½è¿åä»»ä½ç±»åçå¼æè
æ è¿åå¼ï¼voidï¼ï¼æé å¨æ²¡æè¿åå¼ï¼ä¹ä¸éè¦voidã
4ã两è
çå½ååºå«ã
æé å¨ä½¿ç¨åç±»ç¸åçååï¼èæ¹æ³åä¸åãæç
§ä¹ æ¯ï¼æ¹æ³é常ç¨å°ååæ¯å¼å§ï¼èæé å¨é常ç¨å¤§ååæ¯å¼å§ãæé å¨é常æ¯ä¸ä¸ªåè¯ï¼å 为å®åç±»åç¸åï¼èæ¹æ³é常æ´æ¥è¿å¨è¯ï¼å 为å®è¯´æä¸ä¸ªæä½ã
温馨提示:答案为网友推荐,仅供参考