Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java¶¯Ì¬°ó¶¨

ÔËÐÐʱ°ó¶¨Ò²½Ð¶¯Ì¬°ó¶¨£¬ËüÊÇÒ»ÖÖµ÷ÓöÔÏó·½·¨µÄ»úÖÆ¡£Javaµ÷ÓöÔÏó·½·¨Ê±£¬Ò»°ã²ÉÓÃÔËÐÐʱ°ó¶¨»úÖÆ¡£
1£®JavaµÄ·½·¨µ÷Óùý³Ì
±àÒëÆ÷²é¿´¶ÔÏóµÄÉùÃ÷ÀàÐͺͷ½·¨Ãû£¨¶ÔÏó±äÁ¿µÄÉùÃ÷ÀàÐÍ£©¡£Í¨¹ýÉùÃ÷ÀàÐÍÕÒµ½·½·¨ÁÐ±í¡£
±àÒëÆ÷²é¿´µ÷Ó÷½·¨Ê±ÌṩµÄ²ÎÊýÀàÐÍ¡£
Èç¹û·½·¨ÊÇprivate¡¢static¡¢final»òÕß¹¹ÔìÆ÷£¬±àÒëÆ÷¾Í¿ÉÒÔÈ·¶¨µ÷ÓÃÄǸö·½·¨¡£ÕâÊǾ²Ì¬°ó¶¨¡£
Èç¹û²»ÊÇÉÏÊöÇé¿ö£¬¾ÍҪʹÓÃÔËÐÐʱ£¨¶¯Ì¬£©°ó¶¨¡£ÔÚ³ÌÐòÔËÐÐʱ£¬²ÉÓö¯Ì¬°ó¶¨Òâζ×Å£ºÐéÄâ»ú½«µ÷ÓöÔÏóʵ¼ÊÀàÐÍËùÏÞ¶¨µÄ·½·¨¡£
2£®ÔËÐÐʱ£¨¶¯Ì¬£©°ó¶¨µÄ¹ý³Ì
ÐéÄâ»úÌáÈ¡¶ÔÏóµÄʵ¼ÊÀàÐ͵ķ½·¨±í£»
ÐéÄâ»úËÑË÷·½·¨Ç©Ãû£»
µ÷Ó÷½·¨¡£
×¢Ò⣬ÕâÀï˵µÄÊǶÔÏóµÄʵ¼ÊÀàÐÍ¡£¼´ÔÚ¶à̬µÄÇé¿öÏ£¬ÐéÄâ»ú¿ÉÒÔÕÒµ½ËùÔËÐжÔÏóµÄÕæÕýÀàÐÍ¡£
3£®ÔÚÏòÉÏתÐÍÇé¿öϵĶ¯Ì¬°ó¶¨Ê¾Àý

Java´úÂë
public class Father {  
    public void method() {  
       System.out.println("¸¸Àà·½·¨£¬¶ÔÏóÀàÐÍ£º" + this.getClass());  
    }  
}  
   
public class Son extends Father {  
    public static void main(String[] args) {  
       Father sample = new Son();//ÏòÉÏתÐÍ  
       sample.method();  
    }  
}   public class Father { public void method() { System.out.println("¸¸Àà·½·¨£¬¶ÔÏóÀàÐÍ£º" + this.getClass()); } } public class Son extends Father { public static void main(String[] args) { Father sample = new Son();//ÏòÉÏתÐÍ sample.method(); } }

½á¹û1£º
¸¸Àà·½·¨£¬¶ÔÏóÀàÐÍ£ºclass samples.Son

Õâ¸ö½á¹ûûÓÐÒÉÎÊ£¬ÉùÃ÷µÄÊǸ¸ÀàµÄÒýÓ㨾ä±ú£©£¬µ«×¼È·µÄµ÷ÓÃÁË×ÓÀàµÄ¶ÔÏ󣬵÷ÓÃmethod£¬ÔÚ×ÓÀàÖÐûÓи÷½·¨£¬ËùÒÔÈ¥¸¸ÀàÖÐÑ°ÕÒµ½²¢µ÷ÓÃÖ®¡£
ÏÖÔÚÐÞ¸Ä×ÓÀ࣬ÖØд(override)method·½·¨¡£

Java´úÂë
public class Son extends&n


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

javaÖÐinterface ºÍabstract classÇø±ð[תÌû]

abstract classºÍinterfaceÊÇJavaÓïÑÔÖжÔÓÚ³éÏóÀඨÒå½øÐÐÖ§³ÖµÄÁ½ÖÖ»úÖÆ£¬ÕýÊÇÓÉÓÚÕâÁ½ÖÖ»úÖƵĴæÔÚ£¬²Å¸³ÓèÁËJavaÇ¿´óµÄÃæÏò¶ÔÏóÄÜÁ¦¡£abstract classºÍinterfaceÖ®¼äÔÚ¶ÔÓÚ³éÏóÀඨÒåµÄÖ§³Ö·½Ãæ¾ßÓкܴóµÄÏàËÆÐÔ£¬ÉõÖÁ¿ÉÒÔÏ໥Ìæ»»£¬Òò´ËºÜ¶à¿ª·¢ÕßÔÚ½øÐгéÏóÀඨÒåʱ¶ÔÓÚabstract classºÍinterfaceµÄÑ¡ÔñÏԵñȽÏËæÒâ¡ ......

Google Map ±àÂëÕÛÏßËã·¨JavaʵÏÖ

ÍøÂçÉÏÁ÷´«×ÅÒ»¸öGoogle Map ±àÂëÕÛÏßËã·¨µÄJavaʵÏÖ£¬µ«ÊǼÆËã½á¹ûÓëGOOGLE  MAP API °ïÖúÀïÃæµÄ½»»¥¹¤¾ßµÄ¼ÆËã½á¹ûÓгöÈ룬ËùÒÔ×Ô¼ºÐ´ÁËÒ»Ò»¸ö£¬¼ÆËã½á¹ûÓëGOOGLE  MAP API °ïÖúÀïÃæµÄ½»»¥¹¤¾ßµÄ¼ÆËã½á¹ûÒ»Ö¡£package unit;
/**
* Google Map ±àÂëÕÛÏßËã·¨JavaʵÏÖ
*
* @author libin
*/
public cl ......

JNBridgeÌṩÁË¿çÔ½JavaÓë.NET´úÂëµÄ·Ö²¼Ê½ÊÂÎñÖ§³Ö

JNBridgeÌṩÁË¿çÔ½JavaÓë.NET´úÂëµÄ·Ö²¼Ê½ÊÂÎñÖ§³Ö
×÷Õß Jonathan Allen ÒëÕß ÕÅÁú ·¢²¼ÓÚ 2009Äê12ÔÂ28ÈÕ ÉÏÎç5ʱ5·Ö
ÉçÇø .NET, Java Ö÷Ìâ »¥²Ù×÷, ÊÂÎñ´¦Àí ±êÇ© JNBridge
ƾ½èJNBridge¼¼Êõ£¬JavaºÍ.NET´úÂëÎÞÐè½»²æ±àÒëÆ÷¾Í¿ÉÒÔʵÏÖ¶ÔÏó¹²Ïí¡£ËùÓÐJava´úÂëÔËÐÐÔÚJVMÉÏ£¬¶ø.NET´úÂëÔòÔËÐÐÔÚCLRÉÏ¡£Ôڸ÷½°¸Ï£¬JVM ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ