Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

JavaÉè¼Æģʽ֮:IteratorÁ´±íģʽ

ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔ­Àí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
   
    private Object data; //ÔªËر¾Éí
    private NodeBean next; //ÏÂÒ»¸ö½Úµã
   
  &n ......

C#ÓëJAVAµÄ±È½Ï

ºÜ¶àÈË˵C#ÊÇ΢ÈíÓÃÀ´ºÍJava¿¹ºâµÄÎäÆ÷£¬ÒòΪ¶þÕßÔںܴó³Ì¶ÈÉÏÓÐמªÈ˵ÄÏàËÆ£¬¾¡¹ÜÈç´Ë£¬Á½Õß²»Í¬µÄµØ·½Ò²ºÜ¶à£¬Ëùν“ÓÚϸ΢´¦¼û²îÒ씡£ÄÇôÁ½ÕßµÄÏàËƺÍÇø±ð¶¼ÔÚʲôµØ·½ÄØ£¿ÎÒÃÇ´Ó½ñÌ쿪ʼ£¬»á´Ó¸÷¸ö½Ç¶ÈÀ´¶Ô±ÈC#ºÍJavaµÄÌص㣬ϣÍûÄܶÔÕýÔÚѧϰ¡¢Ê¹ÓÃC#µÄÅóÓÑÓÐËù°ïÖú¡£
& Y0 f! I! a4 a1 K
% B# G8 ......

Java·¾¶ÎÊÌâ×îÖÕ½â¾ö·½°¸

Ç°ÑÔ
¡¡¡¡JavaµÄ·¾¶ÎÊÌ⣬·Ç³£ÄѸ㡣×î½üµÄ¹¤×÷Éæ¼°µ½´´½¨ºÍ¶ÁÈ¡ÎļþµÄ¹¤×÷£¬ÕâÀïÎҾ͸ø´ó¼Ò³¹µ×µÃ½â¾öJava·¾¶ÎÊÌâ¡£
¡¡
¡¡ÎÒ±àдÁËÒ»¸ö·½·¨£¬±ÈClassLoader.getResource(String
Ïà¶Ô·¾¶)·½·¨µÄÄÜÁ¦¸üÇ¿¡£Ëü¿ÉÒÔ½ÓÊÜ"../"ÕâÑùµÄ²ÎÊý£¬´ðÓ¦ÎÒÃÇÓÃÏà¶Ô·¾¶À´¶¨Î»classpathÍâÃæµÄ×ÊÔ´¡£ÕâÑù£¬ÎÒÃǾͿÉÒÔʹÓÃÏ ......

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


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