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

java»ñȡϵͳʱ¼ä¼òµ¥·½·¨£¨±Ê¼ÇÖ®Óã©

import java.util.Date;
public class TestDate
{
 public static void main(String[] args)
 {
  Date d=new Date();
  int h=d.getHours();//ʱ
  int m=d.getMinutes();//·Ö
  int s=d.getSeconds();//Ãë
  int y=d.getYear()+1900;//Äê
  int month=d.getMonth()+1;//ÔÂ
  int day=d.getDate();//ÈÕ
  System.out.println(d);
  System.out.println(h);
  System.out.println(m);
  System.out.println(s);
  System.out.println(y);
  System.out.println(month);
  System.out.println(day);
 }
·½·¨¶þ£º£¨ÒÔÏÂÎª×ªÔØ£©
import java.util.*;
/*
 * »ñȡϵͳʱ¼ä
 */
public class GetTime {
 public static void main(String[] args) {
  Date date = new Date();
  int i = date.getDay();
  String xq = null;
  String Time;
  switch (i) {
  case 0:
   xq = "ÐÇÆÚÌì";
   break;
  case 1:
   xq = "ÐÇÆÚÒ»";
   break;
  case 2:
   xq = "ÐÇÆÚ¶þ";
   break;
  case 3:
   xq = "ÐÇÆÚÈý";
   break;
  case 4:
   xq = "ÐÇÆÚËÄ";
   break;
  case 5:
   xq = "ÐÇÆÚÎå";
   break;
  case 6:
   xq = "ÐÇÆÚÁù";
   break;
  }
  Time = (date.getYear() + 1900) + "Äê" + (date.getMonth() + 1) + "ÔÂ"
    + date.getDate() + "ÈÕ " + xq + "\n" + date.getHours() + ":"
    + date.getMinutes() + ":" + date.getSeconds() + "";
  System.out.println(Time);
 }
}


Ïà¹ØÎĵµ£º

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

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

»ùÓÚJavaµÄ¼òÒײ¥·ÅÆ÷

 ÔÚJava AplicationÖÐʵÏֵļòÒײ¥·ÅÆ÷¡£À´Ô´ÓÚºúÇɶàÖ÷±àµÄ¡¶Java³ÌÐòÉè¼Æ°¸Àý½Ì³Ì¡·
ÎÒÊÔÔËÐйýÁË£¬ÆäÖÐµÄ “Ìýº£.wav”,“Ò»¶¨Òª°®Äã.wav”ÒôƵÎļþÒª·ÅÔÚclassËùÔÚµÄÎļþ¼ÐÖУ¬ÇÒÖ»Ö§³Öwav¸ñʽ
Ô´´úÂ룺
import java.applet.Applet;
import java.applet.AudioClip;
import javax.swing.* ......

¡¶javaÓïÑÔ³ÌÐòÉè¼Æ£¨Ò»£©¡·2009Äê×Ôѧ¿¼ÊÔ´ó¸ÙµÚ9ÕÂ

µÚ9Õ ÊäÈëºÍÊä³öÁ÷
(Ò»)¿Î³ÌÄÚÈÝ
9.1×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷
9.1.1 File¶ÔÏó
9.1.2Á÷¶ÔÏó
9.2»º³åʽÊäÈëÊä³ö
9.2.1»º³åʽÊäÈë
9.2.2»º³åʽÊä³ö
9.3Ëæ»ú·ÃÎÊ
9.4Îļþ¶Ô»°¿ò
(¶þ)ѧϰĿµÄÓëÒªÇó
±¾Õ½éÉÜJava³ÌÐòÊý¾ÝÎļþµÄÊäÈëÊä³ö¼¼Êõ¡£ÒªÇóÄܱàд¼òµ¥µÄJavaÎļþ´¦Àí³ÌÐò¡£
(Èý)¿¼ºË֪ʶµãÓ뿼ºËÒªÇó
1.´´½¨File¶ÔÏó£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ