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

Java·´Éä»úÖÆ Ïê½â »ù±¾¹¦

Ò»°ã¶øÑÔ£¬¿ª·¢ÕßÉçȺ˵µ½¶¯Ì¬ÓïÑÔ£¬´óÖÂÈÏͬµÄÒ»¸ö¶¨ÒåÊÇ£º“³ÌÐòÔËÐÐʱ£¬ÔËÐиıä³ÌÐò½á¹¹»ò±äÁ¿ÀàÐÍ£¬ÕâÖÖÓïÑÔ³ÆΪ¶¯Ì¬ÓïÑÔ”¡£´ÓÕâ¸ö¹Ûµã¿´£¬perl,phthon,rubyÊǶ¯Ì¬ÓïÑÔ£¬C++,JAVA,C#²»ÊǶ¯Ì¬ÓïÑÔ¡£
 
ÔÚJavaÔËÐÐʱ»·¾³ÖУ¬¶ÔÓÚÈÎÒâÒ»¸öÀ࣬ÄÜ·ñÖªµÀÕâ¸öÀàÓÐÄÄЩÊôÐԺͷ½·¨£¿¶ÔÓÚÈÎÒâÒ»¸ö¶ÔÏó£¬ÄÜ·ñµ÷ÓÃËüµÄÈÎÒâÒ»¸ö·½·¨£¿ ´ð°¸Êǿ϶¨µÄ£¬ÕâÖÖ¶¯Ì¬»ñÈ¡ÀàµÄÐÅÏ¢ÒÔ¼°¶¯Ì¬µ÷ÓöÔÏóµÄ·½·¨µÄ¹¦ÄÜÀ´×ÔÓÚJavaÓïÑԵķ´Éä(Reflection)»úÖÆ¡£
Java·´Éä»úÖÆÖ÷ÒªÌṩÁËÒÔϹ¦ÄÜ£º
ÔÚÔËÐÐʱÅжÏÈÎÒâÒ»¸ö¶ÔÏóËùÊôµÄÀà¡£
ÔÚÔËÐÐʱ¹¹ÔìÈÎÒâÒ»¸öÀàµÄ¶ÔÏó.
ÔÚÔËÐÐʱÅжÏÈÎÒâÒ»¸öÀàËù¾ßÓеijÉÔ±±äÁ¿ºÍ·½·¨¡£
ÔÚÔËÐÐʱµ÷ÓÃÈÎÒâÒ»¸ö¶ÔÏóµÄ·½·¨¡£
reflectionÊÇJava±»ÊÓΪ¶¯Ì¬(»ò×¼¶¯Ì¬)ÓïÑÔµÄÒ»¸ö¹Ø¼üÐÔÖÊ£¬Õâ¸ö»úÖÆÔËÐгÌÐòÔÚÔËÐÐʱ͸¹ýreflection apisÈ¡µÃÈÎÒâÒ»¸öÒÑÖªÃû³ÆµÄclassµÄ
ÄÚ²¿ÐÅÏ¢£¬°üÀ¨Æämodifiers(ÖîÈçpublic,staticµÈµÈ)£¬superclass(ÀýÈçObject)£¬ÊµÏÖÖ®Interface(ÀýÈçserializable),Ò²°üÀ¨fieldsºÍmethodsµÄËùÓÐÐÅÏ¢£¬²¢¿ÉÓÚÔËÐÐʱ¸Ä±äfieldsÄÚÈÝ»òµ÷ÓÃmethods¡£
 
ÔÚJDKÖУ¬Ö÷ÒªÓÉÒÔÏÂÀàÀ´ÊµÏÖJava·´Éä»úÖÆ£¬ÕâЩÀ඼λÓÚJava.lang.reflect°üÖÐ
ClassÀࣺ´ú±íÒ»¸öÀà
FieldÀࣺ ´ú±íÀàµÄ³ÉÔ±±äÁ¿(³ÉÔ±±äÁ¿Ò²³ÆΪÀàµÄÊôÐÔ)¡£
MethodÀࣺ ´ú±íÀàµÄ·½·¨¡£
ConstructorÀࣺ ´ú±íÀ඼¹¹Ôì·½·¨¡£
ArrayÀࣺ ÌṩÁ˶¯Ì¬´´½¨Êý×飬ÒÔ¼°·ÃÎÊÊý×éµÄÔªËصľ²Ì¬·½·¨
Àý³ÌDumpMethodsÀàÑÝʾÁËReflectionAPIµÄ»ù±¾×÷Óã¬Ëü¶ÁÈ¡ÃüÁîÐвÎÊýÖ¸¶¨µÄÀàÃû£¬È»ºó´òÓ¡Õâ¸öÀàËù¾ßÓеķ½·¨ÐÅÏ¢¡£
public static void main(String args[]){
    Class<?> classType=Class.forName(args[0]);
    Method methods[]=classType.getDeclaredMethods();
    for(int i=0; i<method.length;i++)
    {
         System.out.println(methods[i].toString());
         }
}
 
Àý³ÌReflectTesterÀà½øÒ»²½ÑÝʾÁËReflectionAPIµÄ»ù±¾Ê¹Ó÷½·¨¡£  ReflectTesterÀàÓÐÒ»¸öcopy(Object object)·½·¨£¬Õâ¸ö·½·¨Äܹ»´´½¨Ò»¸öºÍ²ÎÊýobjectͬÑùÀàÐ͵ĶÔÏó£¬È»ºó°Ñobject¶ÔÏóÖеÄËùÓÐÊôÐÔ¿½±´µ½Ð½¨µÄ¶ÔÏóÖУ¬²¢½«Ëü·µ»Ø
 
Õâ¸öÀý×ÓÖ»Äܸ´ÖƼòµ¥µÄJavaBean£¬¼Ù¶¨JavaBea


Ïà¹ØÎĵµ£º

javaѧϰ±Ê¼Ç

×î½üѧϰjavaµÄIO²Ù×÷£¬ÏÖÕûÀíÈçÏÂ
1   ÊäÈëÊä³ö
  javaµÄ¿â½«³ÌÐòÓëÊäÈëÓйصÄÀ඼´ÓInputStream¼Ì³Ð£¬ÓëÊä³öÓйصÄÀ඼´ÓOutStream¼Ì³Ð¡£
ÒÔǰûÓÐÕÆÎÕµÄÏà¹ØÀà  SequenceInputStream ½«Á½¸ö»ò¸ü¶àµÄinputStream ת»»³Éµ¥¸ö¶ÔÏóʹÓá£
2 ÔöÌíÊôÐÔºÍÓÐÓõĽӿÚ
×°ÊÎÆ÷ £º ÀûÓòã´Î»¯¶ÔÏó¶¯Ì¬Í¸Ã÷ ......

JAVAÖеÄArray.sort£¨£©·½·¨

»¨Á˵ãʱ¼äÈ¥Ñо¿£¬Ò²ËãСÓÐÊÕ»ñ£º
Arrays.sort()·½·¨ÔÚJDKÀïÓкܶ࣬ÆäÖÐ×ÅÖØ˵ÏÂ
static void
sort(Object[] a)
static
<T> void
sort(T[] a, Comparator<? super T> c)
Ç°Õß²ÎÊýÖеÄÊý×éaÖеÄËùÓÐÔªËرØÐëʵÏÖcomparable½Ó¿Ú£¬¿ÉÒÔÖØÔØcomparableµÄ·½·¨compareTo£¨£©¡£
ºóÕß² ......

java µÄ×Ô´ø¼¸ÖÖƤ·ôµÄÀàÃû

javax.swing.plaf.metal.MetalLookAndFeel
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
com.sun.java.swing.plaf.mac.MacLookAndFeel
com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel //java6ÐÂƤ·ô£¬²£Á§Í¸Ã÷
ÎÒµÄ×ÊÔ´ÖÐÓÐÏà¹Ø java swing ·½ÃæµÄ½Ì³Ì£¬j ......

java¼¯³É¿ª·¢¹¤¾ßEclipseÓënetbeans±È½Ï


EclipseÓënetbeansʹÓÃÆÀ²â
½çÃæ
1 ÔÚ½çÃæÉÏnetbeans±È½ÏƯÁÁ,ÓѺá£µÃ·Ö 9
2 EclipseÓкÜÇ¿µÄ¶¨ÖÆÐУ¬Ã»netbeansÃÀ¹Û¡£ÊʺϸßÊÖ µÃ·Ö 8
¹¦ÄÜ
²»×ö±È½Ï
̸һЩ¸öÈË¿´·¨:ÔÚ¹¦ÄÜÉÏEclipseÖ§³Ö´óÁ¿µÄÀ©Õ¹,²»½ö½öÊÇÒ»¸ö java¿ª·¢¹¤¾ß,¸ü¿ÉÒÔÓÃÀ´¿ª·¢ c c++
phpµÈµÈ,¹¦ÄÜ¿ÉÒÔÎÞÏÞµÄÀ©Õ¹.netbeansÒ²Ö§³ÖÀ©Õ¹,¿ÉÒ²ÏÖÔ ......

javaÖÐÊý¾Ý¿âµÄ±¸·ÝÓ뻹ԭ

Ê×ÏÈ£¬ÉèÖÃmysqlµÄ»·¾³±äÁ¿£¨ÔÚpathÖÐÌí¼Ó%MYSQL_HOME%\bin£©£¬ÖØÆôµçÄÔ¡£
ÍêÕû´úÂ룺
    /**
     * @param args
     */
    public static void main(String[] args) {
        /*
  &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ