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

JAVA Ö®"·´Éä"


1¡¢ÀàÐÍÄ£°å Class£º
    ÎïÒÔÀà¾Û£º
    ÎÒÃÇ¿ÉÒÔÓÃclass Person{ }   class Animal{ }À´ÃèÊöÒ»ÀàÈË»òÒ»ÀදÎ
    ÄÇôÔÙÏëһϣ¬ÎÒÃÇÊDz»ÊÇ¿ÉÒÔÓÃclass Class{ } À´³éÏóÃèÊöÀàÄØ£¿
    ´ð°¸Ê±¿ÉÒԵģ¬Õâ¾ÍÊÇjdkÖÐµÄ Class ÀࣨÀàÐÍÄ£°å£©£¬
     ClassÀàÒ²¿ÉÒÔ¼òµ¥µÄÀí½âΪÃèÊöÀàµÄÀࣻ
 
    ÎÒÃǵõ½Ò»¸öÀàµÄÀàÐÍÄ£°å¾ÍÏñµÃµ½ÁËÒ»¸öÈ˵ÄDNA£¬
    DNAÖаüº¬µÄÒ»¸öÈ˵ÄËùÓÐÍⲿÐÎ̬ÌØÕ÷£¬
    ij¸öÀàµÄClassÀàÐÍÄ£°åÖÐÒ²¾Í°üº¬µÄ¸ÃÀàµÄËùÓÐÌØÕ÷£¨ÈçÀàÃû¡¢°üÃû¡¢·½·¨……µÈ£© ¡£
    ËùÒÔÎÒÃÇ  Ö»ÒªµÃµ½ÁËÒ»¸öÀàµÄÀàÐÍÄ£°å£¬¾ÍÄܽ«Ò»¸öÀàÆÊÎöµÄºÜÇå³þ¡£
     
2¡¢»ñÈ¡ClassÀàÐÍÄ£°å¶ÔÏóµÄ·½·¨£º
  (1)£ºÍ¨¹ý¶ÔÏóµ÷ÓÃgetClass()·½·¨´´½¨¡£
  (2)£ºÀûÓÃClassÀàÖеÄforName()·½·¨À´´´½¨¡£
  (3)£ºÀûÓÃÀàÐÍÃû(ÀàÃû)À´´´½¨¡£
3¡¢Í¨¹ý·´Éä·½·¨¶¯Ì¬À´»ñÈ¡ÀàÖеķ½·¨ÒÔ¼°¹¹Ô캯Êý£¨Îå²½£©¡£
  (1).ÏÈ»ñÈ¡ÀàÐÍÄ£°å¶ÔÏó£¬
      ¡¶1¡·Student stu=new Student();
             Class c=stu.getClass();
      ¡¶2¡·Class c=Class.forName("ÀàÈ«Ãû");
      ¡¶3¡·Class c=Student.class;
  (2).ͨ¹ýÀàÐÍÄ£°å¶ÔÏóÀ´»ñÈ¡¹¹Ô캯Êý
      ¡¶1¡·»ñÈ¡ÎÞ²Î(ĬÈϹ¹Ôì)
        Class[] arr={};//¹¹Ôì·½·¨µÄ²ÎÊý ÀàÐÍ¡¢Ë³Ðò¡¢¸öÊý£¬´Ë´¦ÎªÎ޲ι¹Ôì¡£
        Constructor con=c.getDeclaredConstructor(arr);
      ¡¶2¡·»ñÈ¡Óвι¹Ôì
        Class[] arr={String.class,int.class,Integer.class};// ¹¹Ôì·½·¨µÄ²ÎÊý ÀàÐÍ¡¢Ë³Ðò¡¢¸öÊý¡£
        Constructor con=c.getDeclaredConstructor(arr);
  (3).µ÷Óù¹Ôì·½·¨´´½¨¶ÔÏó
     &nbs


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

Java¼¯ÈºÖ®session¹²Ïí½â¾ö·½°¸

      Ëæ×Å»¥ÁªÍøµÄÈÕÒæ׳´ó,ÍøÕ¾µÄpvºÍuv³ÉÏßÐÔ»òÕßÖ¸Êý±¶µÄÔö¼Ó.µ¥·þÎñÆ÷µ¥Êý¾Ý¿âÔçÒѾ­²»ÄÜÂú×ãʵ¼ÊÐèÇó.±ÈÈçÏñÊ¢´ó,ÌÔ±¦ÕâÑùµÄ´óÐÍÍøÂ繫˾,¸üÊÇÈç´Ë.
    ¼¯Èº,Ò²¾ÍÊÇÈÃÒ»×é¼ÆËã»ú·þÎñÆ÷Эͬ¹¤×÷,´ï½â¾ö´ó²¢·¢,´óÊý¾ÝÁ¿Æ¿¾±ÎÊÌâ.µ«ÊÇÔÚȺ¼¯ÖÐ,sessionÍùÍùÊÇÒ»¸ö±È½ÈÍ·ÌÛµÄÎ ......

javaµ÷Óô洢¹ý³Ì£¨jdbc & hibernate£©

Ò»¡¢JDBCµ÷Óô洢¹ý³Ì
creat proc proc_select
¡¡¡¡@pid varchar(20)
¡¡¡¡@address varchar(20) output
¡¡¡¡as
¡¡¡¡select @address=address from userinfo where pid=@pid
¡¡¡¡go
¡¡¡¡ÓÃjavaµ÷ÓÃ:
¡¡¡¡class.forName(\"sun.jdbc.odbc.JdbcOdbcDriver\"); //¼ÓÔØÇý¶¯
¡¡¡¡Connection con=DriverManager.ge ......

Java±¾ÖÊÂÛÖ®¹ØÓÚJavaÕ»Óë¶ÑµÄ˼¿¼

 ×ªÌù×Ô http://www.3800hk.com/Article/cxsj/java/jcjcjave/2009-11-10/Article_181759.html
¡¡1. Õ»(stack)Óë¶Ñ(heap)¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾Ý
µÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯
ÖÎÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
¡¡¡¡
¡¡¡¡2. Õ»µÄÓÅÊÆÊÇ£¬´æÈ¡ËٶȱȶÑÒª¿ì£¬½ö´ÎÓÚÖ±½ÓλÓÚCPUÖеļĴæÆ÷¡£µ«È±µãÊÇ£¬ ......

javaµ÷ÓÃÍⲿ³ÌÐò ±Øɱ ·¾¶¿Õ¸ñûÓÐÎÊÌâ

javaµ÷ÓÃÍⲿ³ÌÐò ±Øɱ ·¾¶¿Õ¸ñûÓÐÎÊÌâ      
Runtime rt = Runtime.getRuntime();
srcFile.getName();
try {
String cmd[]={"cmd","/c",srcFile.getAbsolutePath()};
rt.exec(cmd);
} catch (IOException e1) {
// TODO Auto-genera ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ