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

JavaÈÕÆÚ ¼ÆËã

JavaÖÐÌṩÁ˷ḻµÄÈÕÆÚ±íʾ·½Ê½¡£ÆäÖаüÀ¨Date¡¢Timestamp¡¢Calendar¡¢GregorianCalendarÀà¡£GregorianCalendarÀàÖÐÌṩÁËÓÃÓÚ¼ÆËãÈÕÆÚµÄadd()·½·¨£¬¿ÉÒԺܷ½±ãµØ¼ÆËãÈô¸ÉÄê¡¢Ô¡¢ÈÕºóµÄÈÕÆÚ¡£

¸ø¸öÀý×Ó¿´¿´£º


package testjava;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;

public class DateTest {

public static void main(String[] args) {

SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
DateTest test = new DateTest();
//Date
Date currentDate = new Date();
System.out.println("µ±Ç°ÈÕÆÚÊÇ£º" + df.format(currentDate));
System.out.println("Ò»ÖܺóµÄÈÕÆÚÊÇ£º" + df.format(test.nextWeek(currentDate)));
System.out.println("Ò»ÔºóµÄÈÕÆÚÊÇ£º" + df.format(test.nextMonth(currentDate)));
System.out.println("Ò»ÄêºóµÄÈÕÆÚÊÇ£º" + df.format(test.nextYear(currentDate)));
//Timestamp
Timestamp currentTime = new Timestamp(System.currentTimeMillis());
System.out.println("µ±Ç°ÈÕÆÚÊÇ£º" + df.format(currentTime));
System.out.println("Ò»ÖܺóµÄÈÕÆÚÊÇ£º" + df.format(test.nextWeek(currentTime)));
System.out.println("Ò»ÔºóµÄÈÕÆÚÊÇ£º" + df.format(test.nextMonth(currentTime)));
System.out.println("Ò»ÄêºóµÄÈÕÆÚÊÇ£º" + df.format(test.nextYear(currentTime)));

//ÁíÒ»ÖÖ¼ÆË㷽ʽ£¬ÕâÖÖ·½Ê½¼ÆËãÔºÍÄêµÄÈÕÆڱȽÏÀ§ÄÑ
Timestamp nextTime = new Timestamp(currentTime.getTime() + 7 * 24 * 60 * 60 * 1000);
System.out.println("µ±Ç°ÈÕÆÚÊÇ£º" + df.format(currentTime));
System.out.println("Ò»ÖܺóµÄÈÕÆÚÊÇ£º" + df.format(nextTime));

}

//»ñÈ¡ÏÂÒ»ÖܵÄÈÕÆÚ
public Date nextWeek(Date currentDate) {
GregorianCalendar cal = new GregorianCalendar();
cal.setTime(currentDate);
cal.add(GregorianCalendar.DATE, 7);//ÔÚÈÕÆÚÉϼÓ7Ìì
return cal.getTime();
}

//»ñÈ¡±¾ÖÜÈÕµÄÈÕÆÚ
public Date getSunday(Date monday) {
GregorianCalendar cal = new GregorianCalendar();
cal.setTime(monday);
cal.add(GregorianCalendar.DATE, 6);//ÔÚÈÕÆÚÉϼÓ6Ìì
return cal.getTime();
}

//»ñÈ¡ÏÂÒ»ÔµÄÈÕÆÚ
public Date nextMo


Ïà¹ØÎĵµ£º

´«ÖDz¥¿ÍJavaÅàѵ HTML»ù´¡Ê¾Àý

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>ʵÀý1</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME=" ......

JavaÊý¾Ý±¨±à³ÌÖ®×é²¥


ÔÚÐÅϢʱ´ú£¬ÍøÂç¼¼ÊõÓ¦ÓÃÒѷdz£ÆÕͨ¡£ÆäÖзdz£¶àÓ¦Óö¼ÒÀÀµÓÚ´ÓÒ»¸öÖ÷»úÏò¶à¸öÖ÷»ú»ò´Ó¶à¸öÖ÷»úÏò¶à¸öÖ÷»ú·¢ËÍͬһÐÅÏ¢µÄÄÜÁ¦£¬ÔÚInternetÉÏ·Ö·¢µÄÊýÄ¿¿ÉÄÜ´ïÊýÊ®Íǫ̀£¬ÕâЩ¶¼ÐèÒª¸ü¸ßµÄ´ø¿í£¬²¢ÇÒ´ó´ó³¬³öÁ˵¥²¥µÄÄÜÁ¦¡£Ò»ÖÖÄÜ×î´óÏ޶ȵØÀûÓÃÏÖÓдø¿íµÄÖØÒª¼¼ÊõÊÇIP×é²¥¡£
1£®IP×é²¥¼¼ÊõµÄ¸ÅÄî
IP×é²¥¼¼Êõ£¬ÊÇÒ»ÖÖÔÊ ......

JavaÖжÔHashMapµÄÉî¶È·ÖÎö

ÔÚJavaµÄÊÀ½çÀÎÞÂÛÀ໹ÊǸ÷ÖÖÊý¾Ý£¬Æä½á¹¹µÄ´¦ÀíÊÇÕû¸ö³ÌÐòµÄÂß¼­ÒÔ¼°ÐÔÄܵĹؼü¡£ÓÉÓÚ±¾È˽Ӵ¥ÁËÒ»¸öÓйØÐÔÄÜÓëÂß¼­Í¬Ê±²¢´æµÄÎÊÌ⣬ÓÚÊǾͿªÊ¼Ñо¿Õâ·½ÃæµÄÎÊÌâ¡£ÕÒ±éÁË´ó´óССµÄÂÛ̳£¬Ò²°Ñ¡¶Java ÐéÄâ»ú¹æ·¶¡·£¬¡¶apress,.java.collections.(2001),.bm.ocr.6.0.shareconnector¡·£¬ºÍ¡¶Thinking in Java¡··­ÁËÒ²ÕÒ²»µ ......

´«ÖDz¥¿ÍjavaÅàѵORACLE×ܽá(3)


 
ORACLEµÄѧϰÒѾ­¸æÒ»¶Î茖£¬½ñÌìÒѾ­¿ªÊ¼HIBERNATEµÄѧϰ£¬×ÜÌå¸Ð¾õͦÁ¼ºÃµÄ£¬ËäÈ»ºÜ¶àµÄ֪ʶ²»ÄܼÇס£¬µ«ÊÇÔÚʹÓõÄʱºòÄܹ»Ñ¸ËÙµÄÕÒ¶Ô·½·¨À´½â¾öÏàÓ¦µÄÎÊÌ⣬ֻҪÇÚ¼ÓÁ·Ï°£¬¾Í¿ÉÒÔ¼Çס¡£Ö»²»¹ý£¬Ê±¼äÓÐ珢£¬HIBERNATEµÄ¿Î³ÌÒ²Ö»ÓÐÈýÌìµÄʱ¼ä£¬ËùÒÔÔÚÕâÆÚ¼äÎÒµÄÈÎÎñÊǾ¡Á¿ÎüÒý£¬ÔÚ»¨·Å¼ÙµÄʱºòÀ´¸´Ï° ......

JavaÐéÄâ»úÄÚ´æµ÷Õû

JavaÐéÄâ»úĬÈÏ·ÖÅä64MÄڴ棬Èç¹ûÄãµÄÓ¦ÓñȽϴ󣬳¬³ö64MÄڴ棬JavaÐéÄâ»ú¾Í»áÅ׳öOutOfMemoryError£¬²¢Í£Ö¹ÔËÐС£²»¹ÜÊÇʲôӦÓã¨WebÓ¦Óá¢ApplicationµÈ£©£¬Ö»ÐèÒªÐÞ¸ÄÄãµÄ»úÆ÷ÉϵÄÔËÐÐJavaÃüÁÔÚjava xxxÃüÁîÖÐÌí¼Ó-Xms(×îСʹÓÃÄÚ´æ)¡¢-Xmx£¨×î´óʹÓÃÄڴ棩¼´¿É½â¾ö¡£µ±È»£¬Õâ¶ùµÄÄÚ´æÈÝÁ¿¶¼ÊÇÖ¸ÎïÀíÄڴ棬²»Ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ