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

JavaÈÕÆÚÀà³£Ó÷½·¨

1.½«ÈÕÆÚ´æÈëDate¶ÔÏó
SimpleDateFormatÊÇÒ»¸öÈÕÆÚ¸ñʽ»¯Àà¡£yyyy£¬MM£¬dd£¬HH£¬mm,ss,SSS·Ö±ð±íʾÄ꣬Ô£¬ÈÕ£¬Ê±£¬·Ö£¬Ã룬ºÁÃë¡£¿ÉÒÔ½«ËûÃÇËæÒâ×éºÏ£¬¹¹½¨×Ô¼ºµÄÈÕÆÚ¸ñʽ¡£
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
È»ºóÖ»ÐèÒª½«·ûºÏÈÕÆÚ¸ñʽµÄÈÕÆÚ×Ö·û´®´æÈëDate¶ÔÏóÖС£
Date date=sdf.parse("2009-12-21 14:14:30:123");
2.½«Date¶ÔÏóת»»³É×Ö·û´®
ºÍ½«ÈÕÆÚ´æÈëDate¶ÔÏó²î²»¶à¡£
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
String str=sdf.format(date)
3.ÈÕÆÚ´¦Àí
ÕâÀïÐèÒª½èÖúCalendarÀà
´´½¨Ò»¸öCalendar¶ÔÏó
Calendar cal=Calendar.getInstance();
½«ÈÕÆÚ¶ÔÏó·ÅÈëcal
cal.setTime(date);
¼ÓÒ»Ìì
cal
.add(Calendar.DATE, 1);
¼õÒ»Ìì
cal
.add(Calendar.DATE, -1);
ÆäËûµØ·½µÄ¼ÆËã´óÖÂÏàͬ£¬¿ÉÒԲ鿴java-apiÖÐjava.util.CalendarÖеľ²Ì¬×Ö¶Î
°Ñ´¦ÀíºóµÄÈÕÆÚ·ÅÈëDate¶ÔÏóÖÐ
date=
cal
.getTime();
4.Á½¸öÈÕÆÚ¼ÆËã
ÏÖÔÚ»¹Ã»ÓÐÕÒµ½¸üºÃµÄ·½·¨£¬Èç¹ûÒª¼ÆËãÁ½¸öÈÕÆÚÏà²îµÄÌìÊýµÄ»°Ö»ÄÜ°ÑÈÕÆÚת»»³ÉºÁÃë¡£
£¨date2.getTime()-date1.getTime())/3600/1000/24
Ï£ÍûÓиüºÃµÄ·½·¨¡£


Ïà¹ØÎĵµ£º

sql 2005 ´æ´¢¹ý³Ì·ÖÒ³ java ´úÂë

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ ......

½âÎöJavaÀàºÍ¶ÔÏóµÄ³õʼ»¯¹ý³Ì

ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......

Java¸¡µãÊýµÄ¾«È·¼ÆËã¼°±íʾËÄÉáÎåÈëµÄÉèÖÃ

£¨1£©¡¢¸¡µãÊý¾«È·¼ÆËã
ʤÀûÓÍÌïÈýÁ÷ºÏÒ»ÏîÄ¿ÖÐÒ»Ö±´æÔÚÒ»¸öÎÊÌ⣬¾ÍÊÇÿ´Î±¨±íͳ¼ÆµÄÎï×ʽð¶îºÍʵ¼ÊµÄ½ð¶îÒª²îÄÇô¼¸·ÖÇ®£¬ºÍʵ¼Ê½ð¶î²»Ò»Ö£¬Èÿͻ§¾õµÃ×ÜÊDz»ÄÇôÊæ·þ£¬Ô­ÒòÊÇÒòΪÎÒÃÇʹÓÃjavaµÄ¸¡µãÀàÐÍdoubleÀ´¶¨ÒåÎï×ʽð¶î£¬²¢ÇÒÔÚ±¨±íͳ¼ÆÖÐÎÒÃǾ­³£Òª½øÐÐһЩÔËË㣬µ«JavaÖи¡µãÊý£¨double¡¢float£©µÄ¼ÆËãÊǷǾ«È· ......

Java רҵÈËÊ¿±Ø±¸Êé¼®ºÍÍøÕ¾Áбí

¡¡¡¡¶ÔÓÚ Java ÓïÑÔ¿ª·¢ÈËÔ±À´Ëµ£¬ÐÅÏ¢¹ýÁ¿ÊÇÒ»¸öÕæÕýµÄÎÊÌ⡣ÿ¸öÐÂÈëÐеijÌÐòÔ±¶¼ÒªÃæÁÙÒ»¸öÁîÈËηËõµÄÌôÕ½£ºÒª½øÈëµÄÐÐÒµÊÇÒ»¸ö¾ßÓк£Á¿ÖªÊ¶µÄÐÐÒµ¡£ÒªÁ˽âµÄ¶«Î÷¼òֱ̫¶àÁË¡£¶ÔÓÚÓо­ÑéµÄÀÏÊÖÀ´Ëµ£¬Çé¿öÖ»ÓÐЩ΢ºÃת¡£ÖªÊ¶Á¿×ÜÔÚÔö´ó£¬½ö½ö¸úÉϽø¶È¾ÍÊÇÒ»¸öÌôÕ½¡£Èç¹ûÓÐÒ»·ÝרҵÈËÊ¿±Ø±¸µÄÊé¼®ºÍÍøÕ¾Áбí¸ÃÓжàºÃ!±¾Îľ ......

JAVA½ø½×£ºÒ»¸ö¼òµ¥Thread»º³å³ØµÄʵÏÖ


ÔÚÓ¦ÓÃÖУ¬ÎÒÃdz£³£ÐèÒªThread»º³å³ØÀ´×öһЩÊÂÒÔÌá¸ß³ÌÐòµÄЧÂʺͲ¢·¢ÐÔ¡£±¾ÎÄÑÝʾÁËÈçºÎÀûÓÃQueueÕâÖÖÊý¾Ý½á¹¹ÊµÏÖÒ»¸ö¼òµ¥µÄThread»º³å³Ø¡£
Ò»¸öThread»º³å³Ø¿ÉÒÔÉè¼Æ³ÉÒÔÏÂÕâÑù£º»º³å³ØÓɼ¸¸ö¹¤×÷ThreadºÍÒ»¸öQueue×é³É£¬Client¸ºÔð°ÑÈÎÎñ·Åµ½QueueÀïÃ棨put·½·¨£©£¬¶ø¹¤×÷Thread¾ÍÒÀ´ÎÈ¡³öÕâЩÈÎÎñ²¢Ö´ÐÐËüÃÇ£¨get· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ