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

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)){
}...


Ïà¹ØÎĵµ£º

java¿ìËÙÅÅÐò

¿ìËÙÅÅÐòÊǶÔðÅÝÅÅÐòµÄÒ»ÖָĽø¡£ËüµÄ»ù±¾Ë¼ÏëÊÇ£ºÍ¨¹ýÒ»ÌÉÅÅÐò½«ÒªÅÅÐòµÄÊý¾Ý·Ö¸î³É¶ÀÁ¢µÄÁ½²¿·Ö£¬ÆäÖÐÒ»²¿·ÖµÄËùÓÐÊý¾Ý¶¼±ÈÁíÍâÒ»²»²¿·ÖµÄËùÓÐÊý¾Ý¶¼ÒªÐ¡£¬È»ºóÔÙ°´´Î·½·¨¶ÔÕâÁ½²¿·ÖÊý¾Ý·Ö±ð½øÐпìËÙÅÅÐò£¬Õû¸öÅÅÐò¹ý³Ì¿ÉÒԵݹé½øÐУ¬ÒÔ´Ë´ïµ½Õû¸öÊý¾Ý±ä³ÉÓÐÐòÐòÁС£
    ¼ÙÉèÒªÅÅÐòµÄÊý×éÊÇA[1]&hellip ......

JavaÒì³£×ܽá

RuntimeExceptionlÀàÐ͵ÄÒì³£Ó¦Óñê×¼µÄ³ÌÐòÉè¼Æ¼¼ÇÉÀ´Ô¤·À£¬¶ø²»ÊÇʹÓÃtry-catch»úÖƲ¶»ñ¡£Òþº¬Òì³£°üº¬ErrorsºÍRuntimeException£¬¶ÔÓÚºóÕßÓÃifÓï¾ä·ÀÖ¹²úÉú¡£Èç·ÃÎÊ¿ÉÄÜδÕýÈ·³õʼ»¯ÒýÓñäÁ¿Ç°£¬Ïȼì²éÊÇ·ñÖ¸Ïò¿ÕÖµ£»·ÃÎÊÊý×éʱ£¬Ïȼì²éϱêÊÇ·ñÔ½½ç¡£
×Ô¶¨ÒåÒì³££º´´½¨Ò»¸ö¼Ì³ÐExceptionµÄÀà»òÆäËûÒÑ´æÔÚµÄ×ÓÀ࣬´´½¨Ò ......

Java 6 ÖÐ×Ô´øµÄ Java DB(derby) Êý¾Ý¿â

а²×°ÁË JDK 6 µÄ³ÌÐòÔ±ÃÇÒ²Ðí»á·¢ÏÖ£¬³ýÁË´«Í³µÄ bin¡¢jre µÈĿ¼£¬JDK 6 ÐÂÔöÁËÒ»¸öÃûΪ db µÄĿ¼¡£Õâ±ãÊÇ Java 6 µÄгÉÔ±£ºJava DB¡£ÕâÊÇÒ»¸ö´¿ Java ʵÏÖ¡¢¿ªÔ´µÄÊý¾Ý¿â¹ÜÀíϵͳ£¨DBMS£©£¬Ô´ÓÚ Apache Èí¼þ»ù½ð»á£¨ASF£©ÃûϵÄÏîÄ¿ Derby¡£ËüÖ»ÓÐ 2MB ´óС£¬¶Ô±È¶¯éüÉÏ G µÄÊý¾Ý¿âÀ´Ëµ¿ÉνÐäÕä¡£µ«Õâ²¢²»·Á°­ Derby ......

ÓйØjavaÖеÄÒýÓÃÎÊÌâ

Ê×ÏÈ£¬java¶Ô¶ÔÏóºÍ»ù±¾ÀàÐ͵Ĵ¦ÀíÊDz»Ò»ÑùµÄ£¬ºÍCÓïÑÔÒ»Ñù£¬µ±°ÑJavaµÄ»ù±¾Êý¾ÝÀàÐÍ£¨Èçint£¬char£¬doubleµÈ£©×÷ΪÈë¿Ú²ÎÊý´«¸øº¯ÊýÌåµÄʱºò£¬´«ÈëµÄ²ÎÊýÔÚº¯ÊýÌåÄÚ²¿±ä³ÉÁ˾ֲ¿±äÁ¿£¬Õâ¸ö¾Ö²¿±äÁ¿ÊÇÊäÈë²ÎÊýµÄÒ»¸ö¿½±´£¬ËùÓеĺ¯ÊýÌåÄÚ²¿µÄ²Ù×÷¶¼ÊÇÕë¶ÔÕâ¸ö¿½±´µÄ²Ù×÷£¬º¯ÊýÖ´ÐнáÊøºó£¬Õâ¸ö¾Ö²¿±äÁ¿Ò²¾ÍÍê³ÉÁËËüµÄʹÃü£¬ ......

java post get Á¬½ÓÍøÒ³

postºÍgetµÄÇø±ð£º
getÊÇͨ¹ýURLÏò·þÎñÆ÷µÝ½»Êý¾Ý£¬¼´Ìá½»µÄÏà¹ØÐÅÏ¢°üº¬ÔÚµØÖ·À¸µÄURLÖÐ
postÌá½»ºóµØÖ·À¸²»±ä
¿ÉÒÔͨ¹ýJava.net.URLEncoder½«ÖÐÎÄ×Ö·û±äΪ¿ÉÒÔ¼ÓÔÚURLÖÐÓÃÓÚ²éѯµÄ±àÂ룬ÏàÓ¦µÄ£¬Java.net.URLDecoderÓÃÓÚÏà¹ØµÄ½âÂë
Apache¿ªÔ´×éÖ¯ÖеÄhttpclient£¬ËüÁ¥ÊôÓÚJakartaµÄcommonsÏîÄ¿£¬×¨ÃÅÉè¼ÆÀ´¼ò»¯HTTP¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ