Java»ù´¡£ºµÚÊ®Áù½² ÈÕÆÚºÍʱ¼äµÄʹÓÃ
ÔÚJavaÓ¦ÓÃÖУ¬ÈÕÆÚºÍʱ¼ä×÷Ϊ»ù±¾µÄÐÅÏ¢ÀàÐÍÓ¦ÓõÄÌرð¹ã·º£¬ÀýÈç»ñÈ¡µ±Ç°Ê±¼ä£¬¼ÆËãijЩ²Ù×÷Ö´ÐеÄʱ¼äµÈ¡£ÈÕÆÚ´¦ÀíÏà¹ØµÄÀà°üÀ¨DateºÍCalendar£¬Í¨¹ýDateºÍCalendar¿ÉÒÔ»ñÈ¡µ±Ç°Ê±¼ä£¬¶Ôʱ¼ä½øÐÐһЩÔËË㣬»ñȡʱ¼äÖеÄÄê¡¢Ô¡¢ÈÕ¡¢Ê±¡¢·Ö¡¢ÃëºÍÐÇÆÚµÈÐÅÏ¢¡£ÔÚÊäÈëºÍÊä³öµÄʱºò¾³£Óõ½×Ö·û´®ÐÎʽµÄʱ¼ä£¬Õâ¾ÍÐèҪʱ¼äºÍ×Ö·û´®Ö®¼äµÄÏ໥ת»»£¬ÏµÍ³ÌṩÁËDateFormatºÍSimpleDateFormatÀ´Íê³ÉÕâ¸öת»»¡£
java.util.DateÀà
ÓÃÓÚ±íʾÈÕÆÚºÍʱ¼ä£¬Òª»ñÈ¡µ±Ç°Ê±¼ä£¬¿ÉÒÔʹÓÃÏÂÃæµÄ´úÂ룺
¡¾Àý¡¿
// SimpleDateTest.java
import java.util.Date;
public class SimpleDateTest {
public static void main(String[] args) {
// ¶¨Òåʱ¼ä¶ÔÏó
Date d = new Date();
// °´ÕÕĬÈϸñʽÊä³öʱ¼ä
System.out.println(d.toString());
}
}
ÏÂÃæÊÇÊä³öµÄ½á¹û£º
Mon Dec 11 05:32:13 GMT 2006
Èç¹ûÏë°´ÕÕÌض¨µÄ¸ñʽ½øÐÐÊä³ö£¬¿ÉÒÔ°´ÕÕÏÂÃæµÄ·½·¨Íê³É£¬µ«ÊÇÏÖÔڵİ汾Öн¨Ò鲻ҪʹÓá£
¡¾Àý¡¿
// SimpleDate2Test.java
import java.util.Date;
public class SimpleDate2Test {
public static void main(String[] args) {
// ¶¨Òåʱ¼ä¶ÔÏó
Date d = new Date();
// »ñÈ¡Äê
int year = d.getYear()+1900;
// »ñÈ¡ÔÂ
int month = d.getMonth()+1;
// »ñÈ¡ÈÕ
int date = d.getDate();
// »ñȡʱ
int hour = d.getHours();
// »ñÈ¡·Ö
int minute = d.getMinutes();
// »ñÈ¡Ãë
i
Ïà¹ØÎĵµ£º
ÁùÖÖÒì³£´¦ÀíµÄªϰ
Äã¾õµÃ×Ô¼ºÊÇÒ»¸öJavaר¼ÒÂð£¿ÊÇ·ñ¿Ï¶¨×Ô¼ºÒѾȫÃæÕÆÎÕÁËJavaµÄÒì³£´¦Àí»úÖÆ£¿ÔÚÏÂÃæÕâ¶Î´úÂëÖУ¬ÄãÄܹ»Ñ¸ËÙÕÒ³öÒì³£´¦ÀíµÄÁù¸öÎÊÌâÂð£¿
Java´úÂë
OutputStreamWriter out = ...
java.sql.Connection conn =& ......
Java Reflect±àд ͨÓÃÊý×éÀ©Õ¹Àà
package com.accp.array;
import java.lang.reflect.Array;
public class GrowArrayTest {
public static void main(String[] args) {
Integer[] array = {1,2,3,4}; //ͨÓÃÀ©Õ¹
arrayPrint(arra ......
Java ÀíÂÛÓëʵ¼ù: Ãè»æḬ̈߳²È«ÐÔ
2007-12-15 00:10
——Ḭ̈߳²È«²»ÊÇÒ»¸ö·ÇÕæ¼´¼ÙµÄÃüÌâ
Brian Goetz (brian@quiotix.com), Ê×ϯ¹ËÎÊ, Quiotix Corp
2003 Äê 11 ÔÂ 15 ÈÕ
7Ô·ÝÎÒÃǵIJ¢·¢×¨¼Ò Brian Goetz ½« Hashtable ºÍ Vector ÀàÃèÊöΪ“ÓÐÌõ¼þḬ̈߳²È«µÄ”¡£Ò»¸öÀàÄѵÀ²»ÊÇḬ̈߳²È«¾ÍÊÇÏß³Ì ......
±¾ÎÄÄÚÈÝÕª×Ô£º¡¶Java Web¿ª·¢½Ì³Ì——ÈëÃÅÓëÌá¸ßƪ£¨JSP+Servlet£©¡·
½»»¥µÄ»ù±¾¹ý³Ì°üÀ¨£º
l ´´½¨XMLHttpRequest¶ÔÏó£»
l ·¢ËÍÇëÇó£»
l ´¦ÀíÏìÓ¦¡£
´ ......
Õâ¸ö¿ò¼ÜÒ²ÊÇΪgoogle app engine×¼±¸µÄ¡£µ±Ê±¸Ð¾õÖ±½ÓÔÚgaeÉÏsevletÌ«·³ÈËÁË£¬¾Í·â×°¸ö¼òÒ׵Ŀò¼Ü¡£Ê¹ÓõÄʱºòÖ»ÐèÒªÅäÖÃweb.xmlÖÐDispacherSevletºÍpackage.propertiesÖеÄpackage.path£¨Ä¬ÈÏɨÃèµÄ°ü£©¼´¿É
gaeÀý×Ó£ºhttp://orzblogs.appspot.com/Home.htm
´óѧµÄʱºòºÜBS java£¬Ñ§ÁËÖ®ºó¾ÍÈÓµôÁË£¬ÏÖÔÚ¹¤×÷Á˲ſªÊ¼ ......