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

Java Reflection

 
·´ÉäÊÇJavaÓïÑÔÖкÜÖØÒªµÄÒ»¸ö×é³É²¿·Ö£¬ËùÒԾʹ˻°ÌâÌÖÂÛµÄ×ÊÔ´¿ÉνÊýÖ®²»¾¡£¬ÈÕ³£¿ª·¢Ò²»á¾­³£Ê¹Óõ½¹ØÓÚ·´ÉäµÄReflection
API¡£Java5.0
Tiger³öÏÖÒԺ󣬸ü¶Ô·´ÉäAPIÓÐÁËеÄÀ©Õ¹£¬¾¡¹ÜÌÖÂ۵Ļ°ÌâºÜ¶à£¬²»¹ýÎÒ»¹ÊǾõµÃ²»¹»È«Ã棬ÓÈÆäÊǶԷºÐÍÕâÒ»¿é£¬ËùÒÔ¾ÍÎÒËùÖª£¬ÔÙ»¨Á¦Æø×ܽáÒ»·¬
Ê×ÏÈ·´ÉäµÄÈë¿ÚÊÇ´ÓClass¿ªÊ¼µÄ£¬ËùÒÔÈçºÎ»ñÈ¡Class¾Í±äµÃÊ®·Ö¹Ø¼üÁË¡£ÕâÀï×ܽáÁ˼¸ÖÖ·½Ê½£º
1.ͨ¹ý${name}.class Óï·¨¡£ÕâÀï${name}¿ÉÒÔÊǶÔÏó£¬Ò²¿ÉÒÔÊÇԭʼÊý¾ÝÀàÐÍ£¬²»¹ý±ðÍüÁËvoid.classºÍVoid.class
2.ͨ¹ý${name}.TYPE Óï·¨¡£ÕâÀï${name}ÊÇ°ËÖÖԭʼÊý¾ÝµÄ°ü×°ÀàºÍVoid.TYPE
3.ͨ¹ý¶ÔÏóµÄgetClass()·½·¨¡£
4.ͨ¹ýClass¶ÔÏóµÄforName()·½·¨
5.ͨ¹ýÀàClassµÄgetSuperclass()»ñÈ¡¸¸Ç×ÀàClass
6.ͨ¹ýÀàClassµÄgetEnclosingClass()»ñÈ¡ÍⲿÀàClass
7.ͨ¹ýÀàClassµÄgetClasses()ºÍgetDeclaredClasses()»ñÈ¡ÄÚ²¿ÀàClass
ÏÂÃæÊÇÒ»ÕűíÓÃÀ´ËµÃ÷getClasses()ºÍgetDeclaredClasses()Á½¸ö·½·¨£¬ÉÔºó»¹»áÓøñí˵Ã÷ÆäËûReflection API
--------------------------------------------------------------------------------------------
Member
      | Class API
                          | Return type
| Inherited members
| Private members
--------------------------------------------------------------------------------------------
Class            | getDeclaredClasses()         | Array    | N        | Y
                   
| getClasses()                       | Array   | Y          | N
--------------------------------------------------------------------------------------------
Field             | getDeclaredField()     &


Ïà¹ØÎĵµ£º

Tomcat²¿ÊðJava WebÓ¦ÓóÌÐò

ÓÐÁ½ÖÖ·½Ê½£º¾²Ì¬²¿ÊðºÍ¶¯Ì¬²¿Êð¡£ÔÚÏÂÎÄÖÐ$CATALINA_HOMEÖ¸µÄÊÇTomcat¸ùĿ¼¡£
Ò»¡¢¾²Ì¬²¿Êð
¾²Ì¬²¿ÊðÖ¸µÄÊÇÎÒÃÇÔÚ·þÎñÆ÷Æô¶¯Ö®Ç°²¿Êð³ÌÐò£¬Ö»Óе±·þÎñÆ÷Æô¶¯Ö®ºó£¬WebÓ¦ÓóÌÐò²ÅÄÜ·ÃÎÊ¡£ÒÔÏÂ3Öз½Ê½¶¼¿ÉÒÔ²¿Êð£º
1¡¢½«PetWebĿ¼¿½±´µ½$CATALINA_HOME\webappsÏ£¬È»ºóÆô¶¯·þÎñÆ÷¾Í¿ÉÒÔÁË¡£ÕâÖÖ·½Ê½±È½Ï¼òµ¥£¬µ«ÊÇweb ......

Javaµ÷ÓÃOracleÊý¾Ý¿âµÄ·ÖÒ³´æ´¢¹ý³Ì

 ×î½üÏîÄ¿½ø¶È±È½Ï»ºÂý£¬³õ²½Ñо¿ÁËÒ»ÏÂOracleµÄ´æ´¢¹ý³Ì£¬½«´úÂëÌù³öÀ´¡£
 Ê×ÏÈÏÈÌù³öÀ´OracleµÄ·ÖÒ³·ÖÒ³´æ´¢¹ý³Ì´úÂë°É¡£
 1.ÕâÊÇ°üµÄ´úÂë
 create or replace package DB_Oper is
  -- Author  : LIUBING
  -- Created : 2009-10-28 15:01:30
  -- Purpose : ²âÊÔOracleµ ......

javaËæ»úÊýµÄ²úÉú

1. import java.util.*; 
2.(A) public class Test
       { public static void main(String[] args)
         { 
         //Éú³É [0-n) ¸ö²»Öظ´µÄËæ»úÊý  st ÓÃÀ´±£´æ ......

java JNI ³¢ÊÔ

 ¡¡¡¡Ê×ÏÈÒýÓÃһƪÎÄÕ£¬½éÉÜÒ»¸ö¼òµ¥µÄJNIµÄµ÷ÓõĹý³Ì¡£¡¡¡¡JAVAÒÔÆä¿çƽ̨µÄÌØÐÔÉîÊÜÈËÃÇϲ°®£¬¶øÓÖÕýÓÉÓÚËüµÄ¿çƽ̨µÄÄ¿µÄ£¬Ê¹µÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ£¬Ô¼ÊøÁËËüµÄ¹¦ÄÜ¡£½â¾öJAVA¶Ô±¾µØ²Ù×÷µÄÒ»ÖÖ·½·¨¾ÍÊÇJNI¡£¡¡¡¡JAVAͨ¹ýJNIµ÷Óñ¾µØ·½·¨£¬¶ø±¾µØ·½·¨ÊÇÒÔ¿âÎļþµÄÐÎʽ´æ·ÅµÄ£¨ÔÚWINDOWSƽ̨ÉÏÊÇDL ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ