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

Java Dynamic Proxy

import java.lang.reflect.*;
public class A extends Thread  {
    
    public static void main(String[] args) throws Exception{
    CC cc = new CC();
    HH hh = new HH(cc);
    II ii = (II) Proxy.newProxyInstance(HH.class.getClassLoader(),
                        new Class[]{II.class},
                        hh);
    System.out.println ("" + ii.getClass().getName());
    ii.test();
    }
}
interface II {
    void test();
}
class CC implements II {
    public void test() {
    System.out.println ("this is cc");
    }
}
class HH implements InvocationHandler {
    Object obj;
    HH(Object obj) {
    this.obj = obj;
    }
    
    public Object invoke(Object obj, Method m, Object[] args) throws Exception {
    System.out.println ("start");
    Object o = m.invoke(this.obj, args);
    System.out.println ("end");
    return o;
    }
}
ÔËÐÐʱ¼ÓÈë -Dsun.misc.ProxyGenerator.saveGeneratedFiles=true£¬¿ÉÒԵõ½proxy class¡£
²Î¿¼£ºhttp://www.javablogging.com/what-is-java-dynamic-proxies-api/
 


Ïà¹ØÎĵµ£º

ÏîÄ¿ÖÐÄã²»µÃ²»ÖªµÄ11¸öJavaµÚÈý·½Àà¿â

ÏîÄ¿ÖÐÄã²»µÃ²»ÖªµÄ11¸öJavaµÚÈý·½Àà¿â
ÔðÈα༭£ºñûÀï×÷ÕߣºJavaeye   2009-11-02   À´Ô´£ºIT168ÍøÕ¾
Îı¾Tag£º ITÒµ½ç Java Java¿ª·¢¹¤¾ß
¡¡¡¡¡¾IT168 ÆÀÂÛ¡¿JavaµÚÈý·½library ecosystemÊÇÒ»¸öºÜ¹ãÀ«µÄ·¶³ë¡£²»¾ÃÇ°ÓÐÈË׫ÎÄ£ºÃ¿¸öÏîÄ¿ÖУ¬Äã±ØÐëÖªµÀµÄ11¸öJavaµÚÈý·½Àà¿â¡£
¡¡¡¡µ¥Ôª²âÊÔ
¡¡¡¡ ......

Java µ÷Óà Oracle ´æ´¢¹ý³Ì·µ»Ø½á¹û¼¯

Oracle ´æ´¢¹ý³Ì·µ»Ø½á¹û¼¯Óà ref cursor ʵÏÖ¡£
ÊÔÑé²½ÖèÈçÏ£º
1. ½¨Á¢ ref cursor ÀàÐͺ͹ý³Ì
CREATE OR REPLACE PACKAGE types
AS
    TYPE ref_cursor IS REF CURSOR;
END;
/
CREATE TABLE STOCK_PRICES(
    RIC VARCHAR(6) PRIMARY KEY,
    PRICE NUMBER(7 ......

¸øJAVAµÄÐÂÊÖ

ºÜ¶àÈËÕâÑùÎÊ£¬JAVAÔõôѧѽ£¿Ó¦¸Ã¿´Ê²Ã´Êéѽ£¿
ÀÏʵ˵¸öÈËÀ´Ëµ£¬Êé¿´µÃ²»¶à£¬¿ªÊ¼µÄʱºò¾Í¿´Á˱¾ sam's teach yourself Java2 in 24 hours.
ËùÒÔÎÊÆðÕâЩÎÊÌ⣬Õæ²»ºÃ˵,ÿ¸öÈ˶¼²»Ò»Ñù.
×ܵÄÀ´Ëµ,ÎÒ¾õµÃÊǶàÁ·Ï°ÊǺÜÖØÒªµÄ,
²»Òª¿´Ì«¶àÊéÒ»±¾¾Í¿ÉÒÔÁË,µ«Á·Ï°Ò»¶¨Òª¶à×ö,
ѧϰÊÇÒ»¸öÄ£·ÂµÄ¹ý³Ì,
Ä£·ÂµÄ¹ý³ÌÖл¹Òª²» ......

JavaÏà¶Ô·¾¶×ܽá

 1.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:xyz est.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸öURL¾ø¶Ô·¾¶¡£
Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚ
Servl ......

˵˵¶Ôjava nioµÄһЩ¸öÈË×ܽá


Ê×ÏÈÁ˽âÏÂËùνµÄjava nioÊǸöʲô¶«Î÷£¡
IOÊÇ¿¿×Ö·û»ò×Ö½Ú½øÐд«Ê䣬±È½ÏÂý£¡ ¶øNIOÊÇ¿¿¿é£¬ Ò²¾ÍÏ൱ÓÚÒ»¸öBuffer£¬ Ò»¿éÒ»¿é
µÄ´«Ê䣬 ËٶȽϿì
£¡ ͬʱ¼ÓÈëÁ˶àÏß³Ì
µÄ¿ØÖÆ£¬ Ò»¸öNIOÁ÷¿ÉÒÔͬʱ´«Êä¶à¸ö¿éµÈ£¬ Ò²¾ÍÊÇËùνµÄÒì²½´«Êä
£»
´«Í³
µÄ²¢·¢ÐÍ
·þÎñÆ÷Éè¼ÆÊÇÀûÓÃ×èÈûÐÍÍøÂçI/O
ÒÔ¶àÏ̵߳ÄÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ