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

Java AnnotationʹÓôóÈ« (ZT)


Ò»¡¢Annotation¾¿¾¹ÊÇʲô£¿
    Annotation ÌṩÁËÒ»ÌõÓë³ÌÐòÔªËعØÁªÈκÎÐÅÏ¢»òÕßÈκÎÔªÊý¾Ý£¨metadata£©µÄ;¾¶¡£´ÓijЩ·½Ãæ¿´£¬annotation¾ÍÏñÐÞÊηûÒ»Ñù±»Ê¹Ó㬲¢Ó¦ÓÃÓÚ°ü¡¢ÀàÐÍ¡¢¹¹Ôì·½·¨¡¢·½·¨¡¢³ÉÔ±±äÁ¿¡¢²ÎÊý¡¢±¾µØ±äÁ¿µÄÉùÃ÷ÖС£ÕâЩÐÅÏ¢±»´æ´¢ÔÚannotationµÄ“name=value”½á¹¹¶ÔÖС£ annotationÀàÐÍÊÇÒ»ÖÖ½Ó¿Ú£¬Äܹ»Í¨¹ýjava·´ÉäAPIµÄ·½Ê½Ìṩ¶ÔÆäÐÅÏ¢µÄ·ÃÎÊ¡£
    annotationÄܱ»ÓÃÀ´ÎªÄ³¸ö³ÌÐòÔªËØ£¨Àà¡¢·½·¨¡¢³ÉÔ±±äÁ¿µÈ£©¹ØÁªÈκεÄÐÅÏ¢¡£ÐèҪעÒâµÄÊÇ£¬ÕâÀï´æÔÚ×ÅÒ»¸ö»ù±¾µÄDZ¹æÔò£ºannotaion²»ÄÜÓ°Ïì³ÌÐò´úÂëµÄÖ´ÐУ¬ÎÞÂÛÔö¼Ó¡¢É¾³ý annotation£¬´úÂ붼ʼÖÕÈçÒ»µÄÖ´ÐС£ÁíÍ⣬¾¡¹ÜһЩannotationͨ¹ýjavaµÄ·´Éäapi·½·¨ÔÚÔËÐÐʱ±»·ÃÎÊ£¬¶øjavaÓïÑÔ½âÊÍÆ÷ÔÚ¹¤×÷ʱºöÂÔÁËÕâЩannotation¡£ÕýÊÇÓÉÓÚjavaÐéÄâ»úºöÂÔÁËannotation£¬µ¼ÖÂÁËannotationÀàÐÍÔÚ´úÂëÖÐÊÇ“²»Æð×÷ÓԵģ»Ö»ÓÐͨ¹ýijÖÖÅäÌ׵Ť¾ß²Å»á¶ÔannotationÀàÐÍÖеÄÐÅÏ¢½øÐзÃÎʺʹ¦Àí¡£±¾ÎÄÖн«º­¸Ç±ê×¼µÄannotationºÍmeta- annotationÀàÐÍ£¬Åã°éÕâЩannotationÀàÐ͵Ť¾ßÊÇjava±àÒëÆ÷£¨µ±È»ÒªÒÔijÖÖÌØÊâµÄ·½Ê½´¦ÀíËüÃÇ£©¡£
    ÓÉÓÚÉÏÊöÔ­Òò£¬annotationÔÚʹÓÃʱʮ·Ö¼ò±ã¡£Ò»¸ö±¾µØ±äÁ¿¿ÉÒÔ±»Ò»¸öÒÔNonNullÃüÃûµÄannotationÀàÐÍËù±ê×¢£¬À´×÷Ϊ¶ÔÕâ¸ö±¾µØ±äÁ¿²»Äܱ»¸³ÓènullÖµµÄ¶ÏÑÔ¡£¶øÎÒÃÇ¿ÉÒÔ±àдÓëÖ®ÅäÌ×µÄÒ»¸öannotation´úÂë·ÖÎö¹¤¾ß£¬Ê¹ÓÃËüÀ´¶Ô¾ßÓÐÇ°Ãæ±äÁ¿µÄ´úÂë½øÐнâÎö£¬²¢ÇÒ³¢ÊÔÑéÖ¤Õâ¸ö¶ÏÑÔ¡£µ±È»ÕâЩ´úÂë²¢²»±Ø×Ô¼º±àд¡£ÔÚJDK°²×°ºó£¬ÔÚJDK/binĿ¼ÖпÉÒÔÕÒµ½ÃûΪ“apt”µÄ¹¤¾ß£¬ËüÌṩÁË´¦ÀíannotationµÄ¿ò¼Ü£ºËüÆô¶¯ºóɨÃèÔ´´úÂëÖеÄannotation£¬²¢µ÷ÓÃÎÒÃǶ¨ÒåºÃµÄannotation´¦ÀíÆ÷Íê³ÉÎÒÃÇËùÒªÍê³ÉµÄ¹¤×÷£¨±ÈÈçÑé֤ǰÃæÀý×ÓÖеĶÏÑÔ£©¡£Ëµµ½ÕâÀ annotationµÄÇ¿´ó¹¦ÄÜËƺõ¿ÉÒÔÌæ´úXDocletÕâÀàµÄ¹¤¾ßÁË£¬Ëæ×ÅÎÒÃǵÄÉîÈ룬´ó¼Ò»á¸ü¼Ó¼áÐÅÕâÒ»µã¡£
×¢£ºÏêϸÃèÊöÇë²Î¿´jsr250¹æ·¶£º
http://www.jcp.org/aboutJava/communityprocess/pfd/jsr250/
¶þ¡¢AnnotationµÄ¶¨Ò壺
    Õâ¶ÎÎÄ×Ö¿ªÊ¼½éÉÜannotationÏà¹Ø¼¼Êõ¡£ÔÚ´Ë´ó¼Ò½«¿´µ½java5.0µÄ±ê×¼annotationÀàÐÍ£¬ÕâÖÖ±ê×¼ÀàÐ;ÍÊÇÇ°ÎÄÖÐËù˵µÄ“ÄÚ½¨”ÀàÐÍ£¬ËüÃÇ¿ÉÒÔÖ±½Ó±»javacÖ§³Ö¡£¿ÉϲµÄÊÇ£¬ÔÚjava6.0beta°æÖеÄjavacÒѾ­¼ÓÈëÁ˶Ô×Ô¶¨ÒåannotationµÄÖ§³Ö¡£
1¡£AnnotationµÄ¸ÅÄîºÍÓï·¨£º


Ïà¹ØÎĵµ£º

ͨ¹ýjava·´Éä»úÖƶ¯Ì¬µ÷ÓÃij·½·¨µÄ×ܽá

ͨ¹ýjavaµÄ·´Éä»úÖÆ£¬¶¯Ì¬µ÷ÓÃij¸ö·½·¨£º
ÈçÏ£º
public Object invokeMethod(String className, String methodName,
Object[] args) throws Exception{
Class ownerClass = Class.forName(className);
Object owner = ownerClass.newInstance();

Class[] argsClass = new Class[args.length ......

ÅäÖÃJavaºÍeclipse»·¾³


ÀÏ
ʦÈÃÏÂÔØ°²×°jdk1.4¡¢jdk1.5ºÍjdk1.6Èý¸ö°æ±¾µÄJava¿ª·¢°ü£¬²¢ÇÒÊìÁ·Çл»¸÷¸ö»·¾³£¬Æäʵ¾ÍÊÇÅäÖò»Í¬µÄ»·¾³±äÁ¿¡£ÒÔÇ°Ö»ÊÇÔÚ»·¾³±ä
Á¿ÖÐÉèÖÃÁËÓû§±äÁ¿£¬JavaÔËÐÐÒ²ºÜÕý³£¡£Ò»µ©ÐèÒªÔÚ¼¸¸ö°æ±¾ÖÐÇл»£¬Óû§±äÁ¿¾ÍʧЧÁË¡£¾­¹ý³¢ÊÔ²ÅÖªµÀ±ØÐëÉèÖÃϵͳ±äÁ¿£¬ÎªÁË·½±ã¿ÉÒÔÉèÖÃ
JAVA_HOME±äÁ¿ÎªjdkµÄ°²×°Â·¾¶£¬ÔÙ°Ñ %JA ......

javaÄÚ´æ¹ÜÀí¼°ÄÚ´æй¶

    ±àÕß°´£ºJavaÄÚ´æй©ÊÇÿ¸öJava³ÌÐòÔ±¶¼»áÓöµ½µÄÎÊÌ⣬³ÌÐòÔÚ±¾µØÔËÐÐÒ»ÇÐÕý³££¬¿ÉÊDz¼Êðµ½Ô¶¶Ë¾Í»á³öÏÖÄÚ´æÎÞÏÞÖƵÄÔö³¤£¬×îºóϵͳ̱»¾£¬ÄÇôÈç
ºÎ×î¿ì×îºÃµÄ¼ì²â³ÌÐòµÄÎȶ¨ÐÔ£¬·Àֹϵͳ±ÀÅÌ£¬×÷ÕßÓÃ×ÔÒѵÄÇ×Éí¾­ÀúÓë¸÷λÍøÓÑ·ÖÏí½â¾öÕâЩÎÊÌâµÄ°ì·¨¡£
   
×÷ΪInternet×îÁ÷Ðеı ......

javaÐÔÄܵÄÓÅ»¯(Ò»)

 
ÎÒ¶ÔÎÊÌâµÄÀí½â£ºÃæÊÔÖеÄÒ»¸öÎÊÌ⣬¾ÓÈ»ÏëÁË°ëÌìûÓÐʲôͷÐ÷£¬ÎÒÏ뻹ÊÇûÓÐ˼¿¼£¬Ã»ÓлýÀÛ¹ý¡£ÆäʵÍêÈ«¿ÉÒÔ˵ÉÏһЩСϸ½Ú£¬±ÈÈçÓÃStringBuffer´úÌæString£¬ÓÃHashMap´úÌæHashtable, ³Ë·¨²Ù×÷ÓÃλÒÆ£¬¾¡Á¿¸´ÓÃÒÑÓеľ­¹ý¼ìÑéµÄ¸ßЧ´úÂëµÈµÈ¡£
    ÏÂÃæµÄÎÄÕÂתÔØ×Ô±ðµÄÍøÕ¾£¬Ð´µÃºÜרҵ£¬Öܵ½£¬ ......

java php DES ¼ÓÃܽâÃÜ

import java.io.IOException;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class DES {
private byte ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ