java ÈÕÆÚ²î ʵÏÖ(×·ÖÖÓǰ)¹¦ÄÜ
½ñÌì¾ÀíÈÃдһ¸ö£¬¸ù¾ÝÐÅÏ¢ÉÏ´«Ê±¼ä£¬ÏÔʾ£¬£¿·ÖÖÓǰ£¬£¿Ð¡Ê±Ç°£¬£¿Ììǰ£¬ÀàËÆqq¿Õ¼ä·¢±íµÄÐÄÇéÈÕÆÚ£»
ÓÃÁËÒ»¸ö×ÔÎҸоõ±¿µÄ·½·¨£¬²»¹ý»¹ÊÇʵÏÖÁË£¬ºÇºÇºÇ
public static String getCompareTime(String filetime){
//·µ»ØµÄ×Ö·û´®
String retStr ="";
//´«ÈëµÄÈÕÆÚÊÇ2008-9-12µÈ£¬²»×÷´¦Àí
if(filetime.indexOf("-")>0){
retStr =filetime;
}
else{
try{
DateFormat day = new SimpleDateFormat("dd");
DateFormat hour = new SimpleDateFormat("HH");
DateFormat minute = new SimpleDateFormat("mm");
Date today = new Date();
//µÃµ½µ±Ç°Ê±¼äµÄÈÕ£¬Ð¡Ê±£¬·ÖÖÓ
int nowDay =Integer.parseInt(day.format(today));
int nowHour =Integer.parseInt(hour.format(today));
int nowMinute =Integer.parseInt(minute.format(today));
// System.out.println("nowDay:"+nowDay);
// System.out.println("nowDay:"+nowHour);
// System.out.println("nowDay:"+nowMinute);
//¸ñʽ»¯´«ÈëµÄ×Ö·û´®
DateFormat df = new SimpleDateFormat("yy/MM/dd HH:mm:ss");
Date dataTime = df.parse(filetime);
//µÃµ½´«Èëʱ¼äµÄÈÕ£¬Ð¡Ê±£¬·ÖÖÓ
int dataDay =Integer.parseInt(day.format(dataTime));
int dataHour =Integer.parseInt(hour.format(dataTime));
&n
Ïà¹ØÎĵµ£º
Java NIOÀà¿âSelector»úÖÆ½âÎö£¨ÉÏ£©
ÕÔï¿¡¡¡¡ ³Âð©
http://blog.csdn.net/haoel
Ò»¡¢ ǰÑÔ
×Ô´ÓJ2SE 1.4°æ±¾ÒÔÀ´£¬JDK·¢²¼ÁËȫеÄI/OÀà¿â£¬¼ò³ÆNIO£¬Æä²»µ«ÒýÈëÁËȫеĸßЧµÄI/O»úÖÆ£¬Í¬Ê±£¬Ò²ÒýÈëÁ˶à·¸´ÓõÄÒ첽ģʽ¡£NIOµÄ°üÖÐÖ÷Òª°üº¬ÁËÕâÑù¼¸ÖÖ³éÏóÊý¾ÝÀàÐÍ£º
......
ºÃ¼¸Ììûд²©¿Í£¬Õ⼸Ì춼æ×Åд´úÂ룬ÖÐÆÚ¼ì²é¸Õ¹ý£¬ºóÃæÊ£ÏµÄʱ¼äʵ¼ÊºÜÉÙÁË£¬Òª×¥½ôʱ¼äÁË£¬ÂíÉϾ͵ñÏÒµ×ßÈËÁË¡£ÑÔ¹éÕý´«£¬ÔÚ±àÂë¹ý³ÌÖÐÓöµ½µÄÎÊÌ⣬ÎÒ¶¼¼Ç¼ÔÚ²©¿ÍÖУ¬·½±ãÒÔºó²éÔÄдÂÛÎÄ¡£Õâ´ÎÊǼÆËãÍøÂçµØÖ·£¬¸ø³öÒ»¸öipºÍËüµÄ×ÓÍøÑÚÂ룬ͨ¹ýÔËËãµÃµ½ÍøÂçµØÖ·£¨»òÕß˵ÊÇÍøÂçºÅ£©
public static ......
Èç¹û³ÌÐòÊǵ¥Ị̈߳¬Ö´ÐÐÆðÀ´²»±Øµ£ÐÄ´ËÏ̻߳ᱻÆäËûÏ̴߳òÈÅ£¬¾ÍÏñÔÚÏÖʵÖУ¬Í¬Ò»Ê±¼äÖ»Íê³ÉÒ»¼þÊÂÇ飬¿ÉÒÔ²»Óõ£ÐÄÕâ¼þÊÂÇé»á±»ÆäËûÊÂÇé´òÈÅ¡£µ«ÊÇÈç¹û³ÌÐòÖÐͬʱʹÓöàỊ̈߳¬¾ÍºÃ±ÈÏÖʵÖГÁ½¸öÈËͬʱ½øÈëÒ»ÉÈÃÅ”£¬´Ëʱ¾ÍÐèÒª¿ØÖÆ£¬·ñÔòÈÝÒ××èÈû¡£ÎªÁ˱ÜÃâ¶àÏ̹߳²Ïí×ÊÔ´·¢Éú³ ......
volatile¹Ø¼ü×ÖÓÐʲôÓã¿
¿ÖűȽÏÒ»ÏÂvolatileºÍsynchronizedµÄ²»Í¬ÊÇ×îÈÝÒ×½âÊÍÇå³þµÄ¡£volatileÊDZäÁ¿ÐÞÊηû£¬¶øsynchronizedÔò×÷ÓÃÓÚÒ»¶Î´úÂë»ò·½·¨£»¿´ÈçÏÂÈý¾äget´úÂ룺
int i1; ......
Java¹Ø¼ü×Öfinal¡¢staticʹÓÃ×ܽá
Java¹Ø¼ü×Öfinal¡¢staticʹÓÃ×ܽá
Ò»¡¢final
¸ù¾Ý³ÌÐòÉÏÏÂÎÄ»·¾³£¬Java¹Ø¼ü×ÖfinalÓГÕâÊÇÎÞ·¨¸Ä±äµÄ”»òÕß“ÖÕ̬µÄ”º¬Ò壬Ëü¿ÉÒÔÐÞÊηdzéÏóÀà¡¢·Ç³éÏóÀà³ÉÔ±·½·¨ºÍ±äÁ¿¡£Äã¿ÉÄܳöÓÚÁ½ÖÖÀí½â¶øÐèÒª ......