javaĬÈÏ°üµÄʹÓÃ
×î½üÔÚдjava²âÊÔ³ÌÐòµÄʱºòͻȻÓöµ½ÁËÒ»¸öÎÊÌ⣺javaĬÈÏ°üÖеÄpublicÀàÊDz»ÄÜÔÚÆäËû°üÖÐÖ±½Óµ÷ÓõÄ
Ê×ÏÈ£¬×ܽáÒ»ÏÂĬÈÏ°üÖÐÀàµÄʹÓ÷¶Î§£¬javaĬÈÏ°üÖеÄÀà¿ÉÒÔʵÀý»¯ÆäËü°üÖеÄpublicÀ࣬µ«ÊÇÆäËü°üÖеÄÀàÊDz»ÄÜÏÔʽʵÀý»¯Ä¬ÈÏ°üÖеÄÀàÕâ¸öÌØÐÔÔÚJDK1.4ÒÔºóµÄ°æ±¾³ÉÁ¢£»
Æä´Î£¬¿ÉÒÔͨ¹ý·´ÉäÀ´·ÃÎÊĬÈÏ°üÖеÄÀ࣬ÀýÈçÏÂÃæ´úÂë
public class Hello {
private String codeing;
public String getCodeing() {
return codeing + " Hello!";
}
public void setCodeing(String codeing) {
this.codeing = codeing;
}
}
package junit;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import junit.framework.Assert;
import junit.framework.TestCase;
public class TestHello extends TestCase{
public void testDplit() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException{
Class c = Class.forName("Hello");
Method m1 = c.getDeclaredMethod("setCodeing", String.class);
Object ins = c.newInstance();
m1.invoke(ins, "qh");
Method m2 = c.getDeclaredMethod("getCodeing");
Assert.assertEquals((String)m2.invoke(ins),"qh Hello!");
}
}
Ïà¹ØÎĵµ£º
תÔØ×Ô£ºhttp://chenpingtai2008.javaeye.com/blog/253339
ÔçÔÚJava
1.2ÍƳö֮ʱ£¬Javaƽ̨ÖоÍÒýÈëÁËÒ»¸öеÄÖ§³Ö£ºjava.lang.ThreadLocal£¬¸øÎÒÃÇÔÚ±àд¶àÏ̳߳ÌÐòʱÌṩÁËÒ»ÖÖеÄÑ¡Ôñ¡£Ê¹ÓÃ
Õâ¸ö¹¤¾ßÀà¿ÉÒԺܼò½àµØ±àд³öÓÅÃÀµÄ¶àÏ̳߳ÌÐò£¬ËäÈ»ThreadLocal·Ç³£ÓÐÓ㬵«ÊÇËƺõÏÖÔÚÁ˽âËü¡¢Ê¹ÓÃËüµÄÅóÓÑ»¹²»¶à¡£
¡¡ ......
Ò»£® Incident
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[] args) {
......
1.À¬»ø»ØÊյıØÒªÐÔ
µ±¶ÔÏó±»´´½¨Ê±£¬»áÔÚJavaÐéÄâ»úÖзÖÅäÒ»¿éÄڴ棨ÄÚ´æ·ÖÅä-¡·Ä¬ÈÏÖµ-¡·³õʼ»¯Öµ£©£¬ÔÚJVMµÄÉúÃüÖÜÆÚÖУ¬Java³ÌÐòÔÚ²»¶ÏµØ´´½¨¶ÔÏó£¬Èç¹ûÕâЩ¶ÔÏóµÄÄÚ´æ²»±»¼°Ê±»ØÊÕ£¬»áµ¼ÖÂÄÚ´æ¿Õ¼ä²»×㣬Òò´ËÒªÓÐÒ»ÖÖ´ëÊ©¼°Ê±»ØÊÕÎÞÓöÔÏóµÄÄڴ棬±£Ö¤ÄÚ´æÄܹ»±»Öظ´ÀûÓá£
& ......
1.ΪʲôҪʹÓÃÏ̳߳Ø
ÔÚjavaÖУ¬Èç¹ûÿ¸öÇëÇóµ½´ï¾Í´´½¨Ò»¸öÐÂỊ̈߳¬¿ªÏúÊÇÏ൱´óµÄ¡£ÔÚʵ¼ÊʹÓÃÖУ¬·þÎñÆ÷ÔÚ´´½¨ºÍÏú»ÙÏß³ÌÉÏ»¨·ÑµÄʱ¼äºÍÏûºÄµÄϵͳ×ÊÔ´¶¼Ï൱´ó£¬ÉõÖÁ¿ÉÄÜÒª±ÈÔÚ´¦Àíʵ¼ÊµÄÓû§ÇëÇóµÄʱ¼äºÍ×ÊÔ´Òª¶àµÄ¶à¡£³ýÁË´´½¨ºÍÏú»ÙÏ̵߳ĿªÏúÖ®Í⣬»î¶¯µÄÏß³ÌÒ²ÐèÒªÏûºÄϵͳ×ÊÔ´¡ ......
Cavaj Java Decompiler is a graphical freeware utility that reconstructs Java source code from CLASS files. You can decompile Java applets, JAR and ZIP files, producing accurate Java source code. Browse the reconstructed source code with the Class View for instant access to methods and fields. The pr ......