javaÈÕÆÚ
Date ---->String
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String date = sdf.fomat(new Date());
String ---->Date
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse("2010-03-16");
ÈÕÆڱȽϴóС£¬Õâ¾ÍÓõ½ÁËDateÀàÖеÄbefore()ºÍafter()·½·¨¡£¾ßÌå²Î¼ûapi
ÈÕÆÚÔËËã»áÓõ½CalendarÀ࣬×î³£ÓõÄÊÇadd(int field,int amount)Õâ¸ö·½·¨¡£fieldÑ¡ÔñYEAR MONTH DAY_OF_MONTHÆäÖеÄÒ»¸ö
amountΪÔö´óµÄÊýÁ¿¡£
String ¡¢Date¡¢CalendarÈýÕßÖ®¼ä³£¼ûÅäºÏ
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateStr = "2010-3-16";
Date date = sdf.parse(dateStr);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);//ʹÓøø¶¨µÄDateÉèÖÃ´Ë Calendar µÄʱ¼ä
calendar.add(DAY_OF_MONTH,2);//½«¸ø¶¨ÈÕÆÚµÄÕâ¸öÔµÄÈÕ¼Ó2
//´ÓCalendar-->Date
Date temp = calendar.getTime();
while(date.before(temp)){
}...
Ïà¹ØÎĵµ£º
¿ìËÙÅÅÐòÊǶÔðÅÝÅÅÐòµÄÒ»ÖָĽø¡£ËüµÄ»ù±¾Ë¼ÏëÊÇ£ºÍ¨¹ýÒ»ÌÉÅÅÐò½«ÒªÅÅÐòµÄÊý¾Ý·Ö¸î³É¶ÀÁ¢µÄÁ½²¿·Ö£¬ÆäÖÐÒ»²¿·ÖµÄËùÓÐÊý¾Ý¶¼±ÈÁíÍâÒ»²»²¿·ÖµÄËùÓÐÊý¾Ý¶¼ÒªÐ¡£¬È»ºóÔÙ°´´Î·½·¨¶ÔÕâÁ½²¿·ÖÊý¾Ý·Ö±ð½øÐпìËÙÅÅÐò£¬Õû¸öÅÅÐò¹ý³Ì¿ÉÒԵݹé½øÐУ¬ÒÔ´Ë´ïµ½Õû¸öÊý¾Ý±ä³ÉÓÐÐòÐòÁС£
¼ÙÉèÒªÅÅÐòµÄÊý×éÊÇA[1]&hellip ......
ÔÚJavaÖÐÓÐ23ÖÐÉè¼Æģʽ£¬ÏÂÃæÖ»¶Ô²¿·Ö³£ÓõÄÉè¼Æģʽ½éÉÜһϣº
1.µ¥Àýģʽ£¨ÓеÄÊéÉÏ˵½Ðµ¥Ì¬Ä£Ê½Æäʵ¶¼Ò»Ñù£©
¸ÃģʽÖ÷ҪĿµÄÊÇʹÄÚ´æÖб£³Ö1¸ö¶ÔÏ󡣿´ÏÂÃæµÄÀý×Ó£º
package org.sp.singleton;
//·½·¨Ò»
public class Singleton {
//½«×ÔÉíµÄʵÀý¶ÔÏóÉèÖÃΪһ¸öÊôÐÔ,²¢¼ÓÉÏStaticºÍfinalÐÞÊηû
private static f ......
1 Factory Pattern£¨¹¤³§Ä£Ê½£©
¡¡¡¡ÉÏ°ñÀíÓÉ£º½«³ÌÐòÖд´½¨¶ÔÏóµÄ²Ù×÷£¬µ¥¶À³öÀ´´¦Àí£¬´ó´óÌá¸ßÁËϵͳÀ©Õ¹µÄÈáÐÔ£¬½Ó¿ÚµÄ³éÏ󻯴¦Àí¸øÏ໥ÒÀÀµµÄ¶ÔÏó´´½¨ÌṩÁË×îºÃµÄ³éÏóģʽ¡£
¡¡¡¡2 Facade Pattern
¡¡¡¡ÉÏ°ñÀíÓÉ£º½«±íÏÖ²ãºÍÂß¼²ã¸ôÀ룬·â×°µ×²ãµÄ¸´ÔÓ´¦Àí£¬ÎªÓû§Ìṩ¼òµ¥µÄ½Ó¿Ú£¬ÕâÑùµÄÀý×ÓËæ´¦¿É¼û¡£ÃÅÃæģʽºÜ¶ ......
Java JNIÊÇJava Native InterfaceµÄËõд£¬ÖÐÎÄ¿ÉÒëΪJava±¾µØµ÷Óá£Java Native Interface (JNI)±ê×¼³ÉΪjavaƽ̨µÄÒ»²¿·Ö£¬ËüÔÊÐíJava´úÂëºÍÆäËûÓïÑÔдµÄ´úÂë½øÐн»»¥¡£±¾ÎÄÏòÄúÏêϸ½éÉÜJava JNI¡£
Java »·¾³ºÍÓïÑÔ¶ÔÓÚÓ¦ÓóÌÐò¿ª·¢À´ËµÊǷdz£°²È«ºÍ¸ßЧµÄ¡£µ«ÊÇ£¬Ò»Ð©Ó¦ÓóÌÐòÈ´ÐèÒªÖ´Ðд¿ Java ³ÌÐòÎÞ·¨Íê³ÉµÄһЩÈÎÎ ......