JavaµÄ¹¤³§Ä£Ê½Àý×Ó
1. ¼òµ¥¹¤³§:
(1). ´´½¨Êä³ö(Output)½Ó¿Ú
package stone;
public interface Output {
public int MAX_COUNT =10; // ×î¶à¿É´òÓ¡¶àÉÙÌõ¼Ç¼
public void show(); // ´òÓ¡
public void addData(String msg); // °ÑÒª´òÓ¡µÄ¼Ç¼¼ÓÈëµ½´òÓ¡ÅÅÐò
}
(2). ´´½¨´òÓ¡»úÀà, Æä¼Ì³ÐÊä³ö½Ó¿Ú
package stone;
public class Printer implements Output {
private String[] data_array= new String[MAX_COUNT]; // ±£´æÒª´òÓ¡ÐÅÏ¢µÄÊý×é
private int dataNum=0; // Òª´òÓ¡ÐÅÏ¢µÄ¸öÊý
public void addData(String msg) {
if(dataNum>MAX_COUNT) // Òª´òÓ¡µÄÐÅÏ¢²»ÄÜ´óÊ¿×î´óÖµ
System.out.println("Print queue is max");
else
data_array[dataNum++]=msg;
}
public void show() {
while(dataNum>0){
 
Ïà¹ØÎĵµ£º
´Ó5ÔÂ5ºÅ½øÈë¾ÍÒµ°àµ½ÏÖÔÚËÄÌìµÄʱ¼äÁË£¬ÉÏÁËÕ⼸Ìì¿Î·¢ÏÖ¾ÍÒµ°àµÄÇ¿¶ÈÕæµÄºÜ´ó£¬²»ÏñÒÔǰ»ù´¡°àµÄʱºòÄÇô»¹±È½ÏÇáËÉ£¬ÒѾ½¥½¥¸Ð¾õµ½Á˳ÔÁ¦£¬ÒòΪÏÖÔÚÉÏ¿ÎÐèÒª½²½âµÄ֪ʶµãÌ«¶à£¬ÓÐʱºòÏÂÎçÀÏʦ½²µ½6µã¶àÖÓ²ÅÏ¿Σ¬¿ÎÉϵÄÁ·Ï°Ê±¼äÔ½À´Ô½ÉÙÁË£¬Ö»ÄÜ×Ô¼ºÀûÓÿκóµÄʱ¼ä¶àÁ·Ï°Êµ¼ù£¬Ðí¶à¶«Î÷»¹¶¼ÊǵÚÒ»´Î ......
1.2.1 javaÐéÄâ»ú(1)
¡¡javaÐéÄâ»úÊÇÈí¼þÄ£ÄâµÄ¼ÆËã»ú£¬¿ÉÒÔÔÚÈκδ¦ÀíÆ÷ÉÏ£¨ÎÞÂÛÊÇÔÚ¼ÆËã»úÖл¹ÊÇÔÚÆäËüµç×ÓÉ豸ÖУ©°²È«²¢ÇÒ¼æÈݵÄÖ´Ðб£´æÔÚ.classÎļþÖеÄ×Ö½ÚÂë¡£javaÐéÄâ»úµÄ"»úÆ÷Âë"±£´æÔÚ.classÎļþÖУ¬ÓÐʱҲ¿ÉÒÔ³ÆÖ®Îª×Ö½ÚÂëÎļþ¡£java³ÌÐòµÄ¿çƽ̨Ö÷ÒªÊÇÖ¸×Ö½ÚÂëÎļþ¿ÉÒÔÔÚÈκξßÓÐjavaÐéÄâ»úµÄ¼ÆËã»ú»òÕßµç×ÓÉ ......
java²»½öÊDZà³ÌÓïÑÔ£¬»¹ÊÇÒ»¸ö¿ª·¢Æ½Ì¨£¬java¼¼Êõ¸ø³ÌÐòÔ±ÌṩÁËÐí¶à¹¤¾ß£º±àÒëÆ÷¡¢½âÊÍÆ÷¡¢ÎĵµÉú³ÉÆ÷ºÍÎļþ´ò°ü¹¤¾ßµÈµÈ¡£Í¬Ê±java»¹ÊÇÒ»¸ö³ÌÐò·¢²¼Æ½Ì¨£¬ÓÐÁ½ÖÖÖ÷ÒªµÄ"·¢²¼»·¾³"£¬Ê×ÏÈjavaÔËÐÐʱ»·¾³£¨java runtime environment£¬¼ò³ÆJRE£©°üº¬ÁËÍêÕûµÄÀàÎļþ°ü£¬Æä´ÎÐí¶àÖ÷ÒªµÄä¯ÀÀÆ÷¶¼ÌṩÁËjava½âÊÍÆ÷ºÍÔËÐÐʱ»·¾³¡£Ä ......
×îÇ¿ÁÒÍÆ¼ö£ÎÒµÄjavaÊղؼУ¨ÄÚÓйúÄÚ×îºÃµÄjavaÂÛ̳£©
www.chinajavaworld.com -ÂÛ̳È˺ܶ࣬¸ßÊÖÒ²¶à£¬²»¹ýºÃÏñ¶¼ÔÚDZˮ
www.cn-java.com -Ò²ºÜ²»´í£¬ÎÄÕºܺ㬵«ÊǾÍÊÇÉÌÒµÐÔŨÁ˵㡣
www.chinaitlab.com-·Ç³£ÓÐϵͳÐÔ£¬¶øÇÒÍÆ³öµÄjavaÔ¶³Ì½ÌÓýÊÇÖйú×îÈ«ÃæµÄscjpÔ¶³Ì½ÌÓý¡£ www.huihoo. ......
Java»ù´¡·½Ãæ:
1¡¢×÷ÓÃÓòpublic,private,protected,ÒÔ¼°²»Ð´Ê±µÄÇø±ð
´ð£ºÇø±ðÈçÏ£º
×÷ÓÃÓò µ±Ç°Àà ͬһpackage ×ÓËïÀà ÆäËûpackage
public& ......