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

JAVA·´Éä»úÖƵļòµ¥Ó¦ÓÃ

  ¿ª·¢µÄʱºòÓÐʱºò»áÅöµ½ÕâÑùµÄÇé¿ö£¬ÎÒÃÇÔÚд³ÌÐòµÄʱºò²¢²»ÖªµÀÐèÒªµ÷ÓÃij¸ö¶ÔÏóµÄÄĸö·½·¨£¬Ö»ÓгÌÐòÔËÐкó£¬ÎÒÃDzÅÄܹ»ÖªµÀ¡£»òÐíÎÒÃÇÐèÒª¸ù¾Ý¿Í»§¶Ë´«¹ýÀ´µÄij¸öString²ÎÊýµÄÖµÀ´ÅжÏÎÒÃÇÓ¦¸ÃÖ´ÐÐÄĸö·½·¨¡£ÔÚÕâÖÖÇé¿öÏÂJAVAµÄ·´ÉäÖ´ÐоͿÉÒÔ°ïÉÏæÁË¡£ÏÂÃæÊÇÎÒ×öµÄÒ»¸ö¼òµ¥µÄ²âÊÔ´úÂ룬Ìṩ¸ø´ó¼Ò×ö¸ö²Î¿¼¡£
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class TestRef{
public static void main(String[] args){
TestBean test = new TestBean();
Method[] methods = test.getClass().getMethods();
test.setAbc("---");
for(int i=0;i<methods.length;i++){
if(methods[i].getName().equalsIgnoreCase("getabc")){
try {
System.out.println(methods[i].invoke(test));
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
}

from:http://www.blogjava.net/dong/archive/2008/06/05/206083.html


Ïà¹ØÎĵµ£º

java¼¯ºÏÖжÔÏóÅÅÐò

¸ÅÊö£º±¾Ê¾ÀýʵÏÖ¶ÔÏó°´ÄêÁäÉýÐò ÈËÆøÉýÐòÅÅÐò¹¦ÄÜ   ÐÕÃûÉýÐò ½µÐòÅÅÐò¹¦ÄÜ
package ch02;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
 * @author YaoShiyou ʵÏÖ¶ÔÏóÅÅÐò
 *
 */
public class Person {
......

´Ó½ñÈÕÆðÎÒ¿ªÊ¼ÖØÐÂÊ°ÆðJAVAµÄÆìÖÄ£¬×£¸£ÎÒ°É£¡£¡£¡

      ½ñÌìÊǸöºÃÈÕ×Ó£¬ÎªÊ²Ã´Õâô˵ÄØ£¿ÒòΪ½ñÌì½á»éµÄÌرð¶à£¬ÕæµÄÏ൱¶à¡£Ö»ÒªÊǸöÓÐÍ·ÓÐÁ³µÄ·¹µê¶¼»áÓÐÐÂÈËÔÚÄÇÀïÍê³É×Ô¼º×îÃÀÀöµÄ»ØÒä¡£µ«ÎÒµÄÐÄÇéÈ´ÈçÇ°Á½ÈÕµÄÁ¬ÌìÓêÒ»Ñù×ÜÊÇÒõÒõµÄÔÚÏÂÓꡣΪÁËÄÜÈÃ×Ô¼ºÔçÈÕ×ß³öÒõö²£¬ÈÃ×Ô¼ºÄܹ»ÔÙ´Î×öÖ÷×Ô¼ºµÄÈËÉú£¬½ñÌìÎÒ¾ö¶¨Òª»Øµ½ÎÒרҵ¿ª·¢µÄµÀ·ÉÏÀ´£ ......

ÔËÓüÓÃܼ¼Êõ±£»¤JavaÔ´´úÂë

       ÔËÓüÓÃܼ¼Êõ±£»¤JavaÔ´´úÂë
       
java
³ÌÐòµÄÔ´´úÂëºÜÈÝÒ×±»±ðÈË͵¿´¡£Ö»ÒªÓÐÒ»¸ö·´±àÒëÆ÷£¬ÈκÎÈ˶¼¿ÉÒÔ·ÖÎö±ðÈ˵ĴúÂë¡£±¾ÎÄÌÖÂÛÈçºÎÔÚ²»ÐÞ¸ÄÔ­ÓгÌÐòµÄÇé
¿öÏ£¬Í¨¹ý
¼ÓÃÜ
¼¼Êõ±£»¤Ô´´ú
Âë¡£
¡¡¡¡Ò»¡¢ÎªÊ²Ã´Òª
¼ÓÃÜ
£¿

¡¡ ......

¹ØÓÚjavaµÄclasspathÎÊÌâ


package¡¢import
µÄÏà¹ØÎÊÌâÊÇjavaÖеÄÒ»¸ö²»´ó²»Ð¡µÄÎÊÌ⣬µ«classpathÎÊÌâÈ´ÊÇjavaµÄÒ»¸öÖøÃûµÄÄÑÌâ¡£½ñÍíµÃÏÐÑо¿ÁËһϣ¬ÔÚÕâÀォÎÒµÄÑо¿³É¹û¸ú¸÷λ
ÅóÓÑ·ÖÏíһϡ£ÓÉÓÚͬ°üµÄÇé¿öºÜ¼òµ¥£¬ËùÒÔÕâÀï¾Í²»ÌÖÂÛͬ°üÇé¿ö£¬Ö»ÌÖÂÛ²»Í¬°üºÍ²»Í¬Â·¾¶µÄÇé¿ö¡£ÎªÁËÄÜÈöÁÕ߸üÈÝÒ×Àí½â£¬ÎÒÕâÀïÒÔ¾ÙÀýµÄ·½Ê½À´ËµÃ÷ÎÊ
Ìâ¡£
¡ ......

Java ÖеÄIO






<!--
@page { margin: 0.79in }
P { margin-bottom: 0.08in }
-->

JavaÖеÄ
io

ÎÒ¶ÔÁ÷µÄÀí½âÊÇ£ºÔ´µ½Ä¿µÄµØµÄ¹ì¼££¬ËùÒÔÁ÷µÄÒ»¶ËÊÇÊý¾ÝÔ´£¨ÊäÈëÁ÷£©»òÕß½ÓÊÕÆ÷£¨Êä³öÁ÷£©£¬ÁíÒ»¶ËÊÇ
ioÖеÄij¸öÀࣻÕâÀï˵Ã÷Ï£¬
Scanne ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ