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

java ÈÕÆÚ¼ÆËã(¼¸ÌìÇ°ºó)

public class DateTest {
 public static void main(String[] args) {
  Date date = new Date(); // н¨Ò»¸öÈÕÆÚ
  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // ¸ñʽ»¯ÈÕÆÚ
  String beforeDate = sdf.format(getDateBefore(date, 10));
  System.out.println(beforeDate);
  String afterDate = sdf.format(getDateAfter(date, 10));
  System.out.println(afterDate);
 }
 /**
  * µÃµ½¼¸ÌìÇ°µÄʱ¼ä
  */
 public static Date getDateBefore(Date d, int day) {
  Calendar now = Calendar.getInstance();
  now.setTime(d);
  now.set(Calendar.DATE, now.get(Calendar.DATE) - day);
  return now.getTime();
 }
 /**
  * µÃµ½¼¸ÌìºóµÄʱ¼ä
  */
 
 public static Date getDateAfter(Date d, int day) {
  Calendar now = Calendar.getInstance();
  now.setTime(d);
  now.set(Calendar.DATE, now.get(Calendar.DATE) + day);
  return now.getTime();
 }
}


Ïà¹ØÎĵµ£º

AESËã·¨javaʵÏÖdzÎö

      java jce¶ÔaesËã·¨ÓкܺõÄÖ§³Ö£¬µ«ÊÇĬÈÏ°²×°µÄJDK»òÕßJREÊDz»ÄÜÖ§³Öaes192bitÃÜÔ¿ºÍaes256bitÃÜÔ¿Á½ÖÖËã·¨µÄ£¬ÐèÒªµ½sun¹Ù·½ÏÂÔØJava(TM) Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files£¬ÒÔÏÂÊÇjce unilimited strength jurisdiction policy files 6µÄ¹Ù·½ ......

JavaÖеķºÐÍ

    1¡¢Java.utilµÄ¼¯ºÏÀàÖеÄÔªËرØÐëÊǶÔÏ󻯵ģ¬ËûÃDz»ÄÜÊÇ»ù±¾ÀàÐÍ¡£Èç²»ÄÜÉùÃ÷Set<char>»òList<int>¡£µ«¶ÔList<Integer>£¬¿ÉÒÔÍùÀïÃæ¼ÓintÐÍÊý¾Ý£¬Ëü»áÓÃJavaµÄautoboxing»úÖÆ×Ô¶¯×ª»»³ÉInteger¶ÔÏó¡£
    2¡¢²ÎÊý»¯ÀàÖеÄÀàÐͲÎÊý¿ÉÒÔÊÇÊý×éÀàÐÍ£¬ÈçMap< ......

java ±È½ÏÆ÷µÄʹÓÃ

¶ÔÓÚÒ»¸öʵÏÖÁËComparable½Ó¿ÚµÄ¶ÔÏ󣬸ýӿÚÖ»ÄÜʵÏÖÒ»´Î¡£Èç¹ûÔÚÒ»¸ö¼¯ºÏÀïÃæÐèҪʹÓÃidÅÅÐò£¬¶øÔÚÁíÍâÒ»¸ö¼¯ºÏÀïÐèÒª°´Ãû×ÖÅÅÐòÕâʱ¾ÍÐèÒªÔÚÕâ¸ö¼¯ºÏÀïÃæÖ¸¶¨±È½ÏÆ÷¡£
Comparable½Ó¿ÚÉùÃ÷ÁËcompareTo(Object o)·½·¨
Comparator ½Ó¿ÚÉùÃ÷ÁËcompare(Object o1,Object o2)·½·¨
eg:
µÚÒ»¸öÊ÷¼¯ÊÇ°´ÕÕ¶ÔÏóĬÈϵÄidÅÅÐò£¬µ ......

Javaѧϰ±Ê¼Ç1

 Ò»¡¢JavaÔËÐÐʱµÄÁ½ÖÖºËÐÄ»úÖÆ
     £¨1£©JavaÐéÄâ»ú£¨Java Virtual Machine£©
               ÓÃÀ´´¦ÀíJavaÔ´Îļþ±àÒëºóµÄ×Ö½ÚÂ룬ÆÁ±Îµ×²ãÔËÐÐƽ̨µÄ²îÒ죬ʵÏÖ“Ò»´Î±àÒ룬Ëæ´¦Ö´ÐД£¬¶øÇÒ²»Í¬µÄÔËÐÐÆ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ