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

JAVA´¦ÀíÈÕÆÚʱ¼ä³£Ó÷½·¨


Calendar ÀàÊÇÒ»¸ö³éÏóÀ࣬ËüΪÌض¨Ë²¼äÓëÒ»×éÖîÈç YEAR¡¢MONTH¡¢DAY_OF_MONTH¡¢HOUR µÈ ÈÕÀú×Ö¶ÎÖ®¼äµÄת»»ÌṩÁËһЩ·½·¨£¬²¢Îª²Ù×÷ÈÕÀú×ֶΣ¨ÀýÈç»ñµÃÏÂÐÇÆÚµÄÈÕÆÚ£©ÌṩÁËһЩ·½·¨¡£Ë²¼ä¿ÉÓúÁÃëÖµÀ´±íʾ£¬ËüÊǾàÀúÔª£¨¼´¸ñÁÖÍþÖαê׼ʱ¼ä 1970 Äê 1 Ô 1 ÈÕµÄ 00:00:00.000£¬¸ñÀï¸ßÀûÀú£©µÄÆ«ÒÆÁ¿¡£
Àý:
Calendar cal = Calendar.getInstance();//ʹÓÃĬÈÏʱÇøºÍÓïÑÔ»·¾³»ñµÃÒ»¸öÈÕÀú¡£
cal.add(Calendar.DAY_OF_MONTH, -1);//È¡µ±Ç°ÈÕÆÚµÄÇ°Ò»Ìì.
cal.add(Calendar.DAY_OF_MONTH, +1);//È¡µ±Ç°ÈÕÆڵĺóÒ»Ìì.
//ͨ¹ý¸ñʽ»¯Êä³öÈÕÆÚ
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd");
System.out.println("Today is:"+format.format(Calendar.getInstance().getTime()));
System.out.println("yesterday is:"+format.format(cal.getTime()));
µÃµ½2007-12-25ÈÕÆÚ:
Calendar calendar = new GregorianCalendar(2007, 11, 25,0,0,0);
Date date = calendar.getTime();
System.out.println("2007 Christmas is:"+format.format(date));
//javaÔ·ÝÊÇ´Ó0-11,Ô·ÝÉèÖÃʱҪ¼õ1.
//GregorianCalendar¹¹Ôì·½·¨²ÎÊýÒÀ´ÎΪ£ºÄ꣬ÔÂ-1£¬ÈÕ£¬Ê±£¬·Ö£¬Ãë.
È¡ÈÕÆڵIJ¿·Ö:
int year =calendar.get(Calendar.YEAR);
int month=calendar.get(Calendar.MONTH)+1;
int day =calendar.get(Calendar.DAY_OF_MONTH);
int hour =calendar.get(Calendar.HOUR_OF_DAY);
int minute =calendar.get(Calendar.MINUTE);
int seconds =calendar.get(Calendar.SECOND);
È¡Ô·ÝÒª¼Ó1.
Åжϵ±Ç°Ô·ݵÄ×î´óÌìÊý:
Calendar cal = Calendar.getInstance();
int day=cal.getActualMaximum(Calendar.DAY_OF_MONTH);
System.out.println(day);
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
<!--[if !supportLists]-->2.    <!--[endif]-->java.util.Date
Àà Date±íʾÌض¨µÄ˲¼ä£¬¾«È·µ½ºÁÃë¡£´Ó JDK 1.1 ¿ªÊ¼£¬Ó¦¸ÃʹÓà Calendar ÀàʵÏÖÈÕÆÚºÍʱ¼ä×Ö¶ÎÖ®¼äת»»£¬Ê¹Óà DateFormat ÀàÀ´¸ñʽ»¯ºÍ·ÖÎöÈÕÆÚ×Ö·û´®¡£Date ÖеÄÏàÓ¦·½·¨ÒÑ·ÏÆú¡£
¾¡¹Ü Date Àà´òË㷴ӳЭµ÷ÊÀ½çʱ (UTC)£¬µ«ÎÞ·¨×öµ½Èç´Ë׼ȷ£¬ÕâÈ¡¾öÓÚ Java ÐéÄâ»úµÄÖ÷»ú»·¾³¡£µ±Ç°¼¸ºõËùÓвÙ×÷ϵͳ¶¼¼Ù¶¨ 1 Ìì = 24 × 60 × 60 = 86400 Ãë¡£µ«¶ÔÓÚ UTC£¬´óԼÿһÁ½Ä


Ïà¹ØÎĵµ£º

JVMÏê½âÖ®JavaÀ¬»ø»ØÊÕ»úÖÆÏê½âºÍµ÷ÓÅ £¨3£©

 5.ÈçºÎ´ÓJVMÖлñÈ¡ÐÅÏ¢À´½øÐе÷Õû
¡¡¡¡-verbose.gc¿ª¹Ø¿ÉÏÔʾgcµÄ²Ù×÷ÄÚÈÝ¡£´ò¿ªËü£¬¿ÉÒÔÏÔʾ×îæºÍ×î¿ÕÏÐÊÕ¼¯ÐÐΪ·¢ÉúµÄʱ¼ä¡¢ÊÕ¼¯Ç°ºóµÄÄÚ´æ´óС¡¢ÊÕ¼¯ÐèÒªµÄʱ¼äµÈ¡£´ò¿ª- xx:+ printgcdetails¿ª¹Ø£¬¿ÉÒÔÏêϸÁ˽âgcÖеı仯¡£´ò¿ª-XX: + PrintGCTimeStamps¿ª¹Ø£¬¿ÉÒÔÁ˽âÕâЩÀ¬»øÊÕ¼¯·¢ÉúµÄʱ¼ä£¬×ÔjvmÆô¶¯ÒÔºóÒÔ ......

FLASH+JAVA¿ª·¢ÊµÊ±ÍøÂçÓÎÏ·

 ±¾ÎÄ·ÖÁ½²¿·Ö£ºFLASH±à³Ì ºÍ Java±à³Ì£¬´ËÎļǼµÄ½ö½öÊÇÎÒÔÚ̽Ë÷ÖеÄһЩÊÕ»ñ£¬ÆäÖÐÓÃÁ˺ܶà¸öÈË»¯µÄÃèÊöÓïÑÔ£¬²¢²»ÊÇÒµ½ç±ê×¼µÄÓÃÓï¡£ £º£©
̽Ë÷±Ê¼Ç£º  
Ä¿Ç°¹úÄÚFlashÓ¦Óô󲿷ֻ¹ÊÇÔÚÖÆ×÷¾«ÃÀµÄ¶¯»­·½Ã棬µ«¾ÝÎÒÁ˽âÔçÔÚFlash4 µÄʱ´ú£¬¹úÍâһЩÈ˾ÍÒѾ­¿ªÊ¼½«flash¼¼ÊõÔËÓÃÓÚ¿ª·¢¶¯Ì¬ÍøÕ¾£¨ºÍphp¡ ......

JAVA¼¯ºÏ

Vector : »ùÓÚArrayµÄList£¬Æäʵ¾ÍÊÇ·â×°ÁËArrayËù²»¾ß±¸µÄһЩ¹¦ÄÜ·½±ãÎÒÃÇʹÓã¬Ëü²»¿ÉÄÜ×ßÈëArrayµÄÏÞÖÆ¡£ÐÔÄÜÒ²¾Í²»¿ÉÄÜ
³¬Ô½Array¡£ËùÒÔ£¬ÔÚ¿ÉÄܵÄÇé¿öÏ£¬ÎÒÃÇÒª¶àÔËÓÃArray¡£ÁíÍâºÜÖØÒªµÄÒ»µã¾ÍÊÇVector“sychronized”µÄ£¬Õâ¸öÒ²ÊÇVectorºÍ
ArrayListµÄΨһµÄÇø±ð¡£
ArrayList£ºÍ¬VectorÒ»ÑùÊÇÒ»¸ö»ùÓ ......

Java±à³Ì¹æ·¶

 packageµÄÃüÃû package µÄÃû×ÖÓÉÈ«²¿Ð¡Ð´µÄ×Öĸ×é³É£¬ÀýÈ磺cn.mybole¡£
classºÍinterfaceµÄÃüÃû classºÍinterfaceµÄÃû×ÖÓÉ´óд×Öĸ¿ªÍ·¶øÆäËû×Öĸ¶¼Ð¡Ð´µÄµ¥´Ê×é³É£¬ÀýÈ磺Person£¬RuntimeException¡£
class±äÁ¿µÄÃüÃû ±äÁ¿µÄÃû×ÖÓÃÒ»¸öСд×Öĸ¿ªÍ·£¬ºóÃæµÄµ¥´ÊÓôóд×Öĸ¿ªÍ·,ÀýÈ磺index£¬currentImage¡£
clas ......

javaÀàÐÍѧϰ


Ò»¸öjavaÎļþÖУ¬ÓÐÇÒÖ»ÓÐÒ»¸öpublicÀà
float ff= 1.3f;(4B)
int 4B;
long 8B;
double 8B;
byte Ò»×Ö½ÚÕûÐÍ
char 2B
Êý×é
int num[] = new int[3];
int[] num;
num = new int[3];
int [] num = new int[]{1,2,3};
int [][] num;
num = new int[3][4];
//²»Í¬³¤
num = new int[3][];
num[0] = new int[5]; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ