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

java ×¢ÊÍ : annotations ÔªÊý¾Ý

annotations : ×¢ÊÍ
ºÃ´¦
1.Îĵµ±àÖÆ
2.±àÒëÆ÷¼ì²é
3.´úÂë·ÖÎö
JSR 175 ÊDZà³ÌÓïÑÔµÄÔªÊý¾Ý¹¤¾ß,Ϊ½«ÔªÊý¾ÝºÏ²¢µ½ºËÐÄjavaÓïÑÔÖÐÌṩÕýʽÀíÓɺÍ˵Ã÷
»ù±¾ÖªÊ¶:
×¢ÊͲÉÓÃ"@"±ê¼ÇÐÎʽ,ºóÃæÊÇ×¢ÊÍÃû³Æ,È»ºóÔÚÐèÒªÊý¾Ýʱ,ͨ¹ýname=value¶ÔÏò×¢ÊÍÌṩÊý¾Ý
×¢Ê͵ÄÈý¸ö»ù±¾ÖÖÀà:
    ±ê¼Ç×¢ÊÍ
        ûÓбäÁ¿,×¢ÊÍÏÔʾ¼òµ¥,ÓÉÃû³Æ±êʶ,ûÓÐÌṩÆäËûÊý¾Ý,(@fweiAnnotation)
    µ¥Ò»Öµ×¢ÊÍ
        Óë±ê¼Ç×¢ÊÍÀàËÆ,µ«Ìṩһ¶ÎÊý¾Ý,(@fweiAnnotation("value"))
    ÍêÕû×¢ÊÍ
       
Óжà¸öÊý¾Ý³ÉÔ±,ʹÓÃÍêÕûµÄÓï·¨(@feiAnnotation(name1="value1",name2="value2"))
    ¿ÉÒÔÔÚÐèÒª´«ËͶà¸öֵʱʹÓÃÃû-Öµ¶Ô,
    »¹¿ÉÒÔͨ¹ý»¨À¨ºÅΪעÊͱäÁ¿ÌṩֵÊý×é
        @fwei2Annotation({
            @TODO(name="value",name1="value1"),
            @TODO(name="value",name1="value1"),
            @TODO(name="value",name1="value1"),
        })
        ˵Ã÷:fwei2Annotation×¢ÊÍÀàÐÍÊÇÒ»¸ö¾ßÓÐÖµµÄ±äÁ¿,Óëµ¥Ò»Öµ×¢ÊÍÀàÐÍÏà·û,Ö»ÊÇÕâÀïµÄµ¥Ò»ÖµÊÇÊý×é
        ¸ÃÊý×é°üº¬Èý¸öTODO×¢ÊÍ,ÆäÖÐÿ¸ö×¢ÊͶ¼ÊǶàÖµµÄ.¶ººÅ·Ö¸ôÿ¸ö×¢ÊÍÄÚµÄÖµ,ÒÔ¼°µ¥¸öÊý×éÄÚµÄÖµ
Override×¢ÊÍ(±ê¼Ç×¢ÊÍ)(±ê¼Ç×¢ÊÍûÓгÉÔ±±äÁ¿)
½öÓÃÓÚ·½·¨(²»ÓÃÓÚÀà,°üÉùÃ÷»òÆäËû¹¹Ôì)
Ö¸Ã÷×¢Ê͵ķ½·¨½«¸²¸Ç³¬ÀàÖеķ½·¨
Deprecated×¢ÊÍ(±ê¼Ç×¢ÊÍ)
¶Ô²»Ó¦ÔÙʹÓõķ½·¨½øÐÐ×¢ÊÍ
SuppressWarnings×¢ÊÍ
ºöÊÓij²¿·Öwarnings
SuppressWarnings×¢Ê͵ÄvalueÖµ¿ÉÒÔÊǵ¥Öµ»òÊÇÊý×é
@SuppressWarings(value={"unchecked"})
@SuppressWarnings(value={"unchecked", "fallthrough"})
¶¨ÖÆ×¢ÊÍ
TigerÖÐÔö¼ÓÁËÒ»ÖÖеÄÀàÐ


Ïà¹ØÎĵµ£º

java ½øÖÆת»»

public class Test { 
      public static void main(String args[]) {  
        System.out.println(Integer.toBinaryString(20));   //Ê®½øÖÆ-->2½øÖÆ  
        System ......

java socketºÍ¶àỊ̈߳¨Thread£©ÊµÀý

1. socketͨÐÅ£ºÓпͻ§¶ËºÍ·þÎñ¶ËµÄsocket´úÂë¡£
2.
¶àỊ̈߳º¿Í»§¶ËºÍ·þÎñ¶Ë¸÷ÓÃÒ»Ï̷߳¢ËÍÐÅÏ¢£»·þÎñ¶ËÁíÓÐÒ»¼àÌýỊ̈߳¬ÓÃÓڰѳ¬Ê±µÄÐÅϢɾ³ý¡£
   
ÕâÀïÓ¦Óõ½ÁËͬ²½£¬Ê¹Á½¸öÏ߳̿ÉÒÔ²Ù×÷ͬһ¸ömap¡£
´úÂ룺£¨ÀàÈ«ÔÚͬһ¸ö°üÄÚ£©
server¶Ë£º
import java.io.BufferedReader;
import java.i ......

JAVA GC

Êܵ½“15ÄêÄã»ýÀÛÁËʲô”Ò»ÎĵÄÕ𶯣¬ÌرðÊÕ¼¯¸ÃÎÄѧϰ
Java gc
¹Ø¼ü×Ö: java gc, À¬»ø»ØÊÕ»úÖÆ
1.JVMµÄgc¸ÅÊö
¡¡¡¡gc¼´À¬»øÊÕ¼¯»úÖÆÊÇÖ¸jvmÓÃÓÚÊÍ·ÅÄÇЩ²»ÔÙʹÓõĶÔÏóËùÕ¼ÓõÄÄÚ´æ¡£javaÓïÑÔ²¢²»ÒªÇójvmÓÐgc£¬Ò²Ã»Óй涨gcÈçºÎ¹¤×÷¡£²»¹ý³£ÓõÄjvm¶¼ÓÐgc£¬¶øÇÒ´ó¶àÊýgc¶¼Ê¹ÓÃÀàËƵÄËã·¨¹ÜÀíÄÚ´æºÍÖ´ÐÐÊÕ ......

java ʹÓÃeval.jar½âÎö¹«Ê½

eval.jar ÐèÒªµ½https://eval.dev.java.net/
ÏÂÔØ
--ÏÂÃæÊÇʾÀýʹÓã¬Ö§³ÖÖÐÎıäÁ¿
Expression exp = new
Expression("(x + y)/2"
);

Map<String, BigDecimal> variables = new
HashMap<String, BigDecimal>();
variables.put("x", new
BigDecimal("4.32"
)); ......

ÀûÓÃphpÖеÄevalÀ´Ä£ÄâjavaÖеĶ¯Ì¬´úÀí

ʹÓÃjavaÖеĶ¯Ì¬´úÀí¿ÉÒÔÍê³ÉºÜ¶àÊÂÇ飬±ÈÈ罫ҵÎñʵÀý½øÐÐÍйܣ¬ÊµÏÖAOPµÈ£¬µ«ÊÇPhpÖÐûÓÐʵÏÖÕâÑùµÄ¶«Î÷£¬×òÌìͻȻÏëµ½Æäʵ¿ÉÒÔͨ¹ýevalÀ´Ä£ÄâÒ»¸ö¶¯Ì¬´úÀí»úÖÆ¡£php±Èjava²»Í¬µÄÊÇ£¬phpÊDz»ÐèÒª±àÒëµÄ£¬Òò´ËÖ»ÒªÎÒÃÇÄܹ»¶¯Ì¬Éú³ÉÒ»¶Î´úÂ룬ȻºóÓÃevalÀ´Ö´ÐоͿÉÒԴﵽЧ¹û¡£´úÂëÈçÏ£º
/**
* ´úÀíʵÏÖÀà
*/
inter ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ