Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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
Ï£ÍûÓиüºÃµÄ·½·¨¡£


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

ApplicationºÍJava AppletµÄÇø±ð

JavaÓïÑÔÊÇÒ»ÖÖ°ë±àÒë°ë½âÊ͵ÄÓïÑÔ¡£JavaµÄÓû§³ÌÐò·ÖΪÁ½ÀࣺJava ApplicationºÍJava Applet¡£ÕâÁ½Àà³ÌÐòÔÚ×é³É½á¹¹ºÍÖ´ÐлúÖÆÉ϶¼ÓÐÒ»¶¨µÄ²îÒ죬Ö÷ÒªÌåÏÖÔÚÒÔϼ¸·½Ã棺
£¨1£©ÔËÐз½Ê½²»Í¬¡£Java ApplicationÊÇÍêÕûµÄ³ÌÐò£¬¿ÉÒÔ¶ÀÁ¢ÔËÐУ»Java Applet³ÌÐò²»Äܵ¥¶ÀÔËÐУ¬Ëü±ØÐëǶÈëµ½ÓÃHTMLÓïÑÔ±àдµ ......

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

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

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


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

Java·ºÐÍÓ¦¸Ã×¢ÒâµÄϸ½Ú

1¡¢²»¿ÉÒÔÓÃÒ»¸ö±¾µØÀàÐÍ£¨Èçint   float£©À´Ìæ»»·ºÐÍ.±ÈÈçList<Integer>²»ÄÜÓÃList<int>ÐÍʽ
2¡¢ÔËÐÐʱÀàÐͼì²é£¬²»Í¬ÀàÐ͵ķºÐÍÀàÊǵȼ۵ģ¨Pair<String>ÓëPair<Employee>ÊÇÊôÓÚͬһ¸ö
ÀàÐÍ Pair£©£¬ÕâÒ»µãÒªÌرð×¢Òâ:¼´Èç¹ûa instanceof
Pair<String>==trueµÄ»°£¬²¢²»´ú±ía. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ