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

dzÎöJavaµÄ¡°¿Ë¡¡±·½·¨ תÌù

ZT:http://javahy.javaeye.com/blog/384871
¡¡¡¡JavaÓïÑÔµÄÒ»¸öÓŵã¾ÍÊÇÈ¡ÏûÁËÖ¸ÕëµÄ¸ÅÄµ«Ò²µ¼ÖÂÁËÐí¶à³ÌÐòÔ±ÔÚ±à³ÌÖг£³£ºöÂÔÁ˶ÔÏóÓëÒýÓõÄÇø±ð£¬±¾ÎÄ»áÊÔͼ³ÎÇåÕâÒ»¸ÅÄî¡£²¢ÇÒÓÉÓÚJava²»ÄÜͨ¹ý¼òµ¥µÄ¸³ÖµÀ´½â¾ö¶ÔÏó¸´ÖƵÄÎÊÌ⣬ÔÚ¿ª·¢¹ý³ÌÖУ¬Ò²³£³£ÒªÒªÓ¦ÓÃclone£¨£©·½·¨À´¸´ÖƶÔÏó¡£±¾ÎÄ»áÈÃÄãÁ˽âʲôÊÇÓ°×ÓcloneÓëÉî¶Èclone£¬ÈÏʶËüÃǵÄÇø±ð¡¢Óŵ㼰ȱµã¡£
¡¡¡¡¿´µ½Õâ¸ö±êÌ⣬ÊDz»ÊÇÓеãÀ§»ó£ºJavaÓïÑÔÃ÷ȷ˵Ã÷È¡ÏûÁËÖ¸Õ룬ÒòΪָÕëÍùÍùÊÇÔÚ´øÀ´·½±ãµÄͬʱҲÊǵ¼Ö´úÂë²»°²È«µÄ¸ùÔ´£¬Í¬Ê±Ò²»áʹ³ÌÐòµÄ±äµÃ·Ç³£¸´ÔÓÄÑÒÔÀí½â£¬ÀÄÓÃÖ¸Õëд³ÉµÄ´úÂë²»ÑÇÓÚʹÓÃÔçÒѳôÃûÕÑÖøµÄ"GOTO"Óï¾ä¡£Java·ÅÆúÖ¸ÕëµÄ¸ÅÄî¾ø¶ÔÊǼ«ÆäÃ÷Öǵġ£µ«ÕâÖ»ÊÇÔÚJavaÓïÑÔÖÐûÓÐÃ÷È·µÄÖ¸Õ붨Ò壬ʵÖÊÉÏÿһ¸önewÓï¾ä·µ»ØµÄ¶¼ÊÇÒ»¸öÖ¸ÕëµÄÒýÓã¬Ö»²»¹ýÔÚ´ó¶àʱºòJavaÖв»ÓùØÐÄÈçºÎ²Ù×÷Õâ¸ö"Ö¸Õë"£¬¸ü²»ÓÃÏóÔÚ²Ù×÷C£«£«µÄÖ¸ÕëÄÇÑùµ¨Õ½Ðľª¡£Î¨Ò»Òª¶à¶à¹ØÐĵÄÊÇÔÚ¸øº¯Êý´«µÝ¶ÔÏóµÄʱºò¡£ÈçÏÂÀý³Ì£º
package reference;
class Obj{
¡¡String str = "init value";
¡¡public String toString(){
¡¡¡¡return str;
¡¡}
}
public class ObjRef{
¡¡Obj aObj = new Obj();
¡¡int aInt = 11;
¡¡public void changeObj(Obj inObj){
¡¡¡¡inObj.str = "changed value";
¡¡}
¡¡public void changePri(int inInt){
¡¡¡¡inInt = 22;
¡¡}
¡¡public static void main(String[] args)
¡¡{
¡¡¡¡ObjRef oRef = new ObjRef();
¡¡¡¡System.out.println("Before call changeObj() method: " + oRef.aObj);
¡¡¡¡oRef.changeObj(oRef.aObj);
¡¡¡¡System.out.println("After call changeObj() method: " + oRef.aObj);
¡¡¡¡System.out.println("==================Print Primtive=================");
¡¡¡¡System.out.println("Before call changePri() method: " + oRef.aInt);
¡¡¡¡oRef.changePri(oRef.aInt);
¡¡¡¡System.out.println("After call changePri() method: " + oRef.aInt);
¡¡}
}
/* RUN RESULT
Before call changeObj() method: init value
After call changeObj() method: changed value
==================Print Primtive=================
Before call changePri() method: 11
After call changePri() method: 11
*
*/
¡¡¡¡Õâ¶Î´úÂëµÄÖ÷Òª²¿·Öµ÷ÓÃÁËÁ½¸öºÜÏà½üµÄ·½·¨£¬changeObj()ºÍchangePri()¡£Î¨Ò»²


Ïà¹ØÎĵµ£º

Java Interface Êdz£Á¿´æ·ÅµÄ×î¼ÑµØµãÂð£¿

ÓÉÓÚjava interfaceÖÐÉùÃ÷µÄ×Ö¶ÎÔÚ±àÒëʱ»á×Ô¶¯¼ÓÉÏstatic finalµÄÐÞÊηû£¬¼´ÉùÃ÷Ϊ³£Á¿¡£Òò¶øinterfaceͨ³£ÊÇ´æ·Å³£Á¿µÄ×î¼ÑµØµã¡£È»¶øÔÚjavaµÄʵ¼ÊÓ¦ÓÃʱȴ»á²úÉúһЩÎÊÌâ¡£
ÓÉÓÚjava interfaceÖÐÉùÃ÷µÄ×Ö¶ÎÔÚ±àÒëʱ»á×Ô¶¯¼ÓÉÏstatic finalµÄÐÞÊηû£¬¼´ÉùÃ÷Ϊ³£Á¿¡£Òò¶øinterfaceͨ³£ÊÇ´æ·Å³£Á¿µÄ×î¼ÑµØµã¡£È»¶øÔÚjavaµÄ ......

JAVA ´úÀíģʽ

¶¯Ì¬´úÀí£º
public interface Qingke {
void qk();
}
public class dsz implements Qingke{
 
 public void qk() {
  System.out.print("dsz qk");
 }
}
public class Secretary implements InvocationHandler {
 private Object pro;
 private dsz dsz;
 public Obj ......

JAVA JDBC ¼òµ¥·ÖÒ³

        /**
          *ÐèÒª´«Èë pageNo µ±Ç°Ò³
          *             pageSizeÒ»Ò³ÏÔʾµÄÌõÊý
      ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ