javaµÄ¶¨Ê±Æ÷ʹÓ÷½·¨
java¶¨Ê±Æ÷µÄʹÓÃ
¶¨Ê±Æ÷ÀàTimerÔÚjava.util°üÖС£Ê¹ÓÃʱ£¬ÏÈʵÀý»¯£¬È»ºóʹÓÃʵÀýµÄschedule(TimerTask task, long delay)·½·¨£¬É趨ָ¶¨µÄÈÎÎñtaskÔÚÖ¸¶¨µÄÑÓ³ÙdelayºóÖ´ÐС£¶¨Ê±Æ÷ÈÎÎñÀàTimerTaskÊdzéÏóÀ࣬¼Ì³Ð²¢ÖØÐ´Æärun()·½·¨£¬¿ÉʵÏÖ¾ßÌåÈÎÎñ¡£
schedule(TimerTask task, Date time)É趨ָ¶¨ÈÎÎñtaskÔÚÖ¸¶¨Ê±¼ätimeÖ´ÐС£
cancel()·½·¨½áÊøÕâ¸ö¶¨Ê±Æ÷¡£
schedule(TimerTask task, long delay, long period)·½·¨É趨ָ¶¨ÈÎÎñtaskÔÚÖ¸¶¨ÑÓ³Ùdelayºó½øÐй̶¨ÑÓ³ÙperoidµÄÖ´ÐС£
scheduleAtFixedRate(TimerTask task, long delay, long period)·½·¨É趨ָ¶¨ÈÎÎñtaskÔÚÖ¸¶¨ÑÓ³Ùdelayºó½øÐй̶¨ÆµÂÊperoidµÄÖ´ÐС£
ҪʵÏÖÒ»¸ö¶¨Ê±ÈÎÎñ£¬ÔËÓÃjavaÖеÄTimerºÍTimerTaskÀà¿ÉÒԷdz£ÈÝÒ×ʵÏÖʵʱµ÷Óô¦Àíº¯Êý¡£ÕâÁ½¸öÀàʹÓÃÆðÀ´·Ç³£·½±ã£¬¿ÉÒÔÍê³ÉÎÒÃǶԶ¨Ê±Æ÷µÄ¾ø´ó¶àÊýÐèÒª¡£
¿´¸ö¼òµ¥µÄÀý×Ó:
import java.io.IOException;
import java.util.Timer;
public class TimerTest {
public static void main(String[] args){
Timer timer = new Timer();
//Ò²¿ÉÒÔ×Ô¶¨Òåʱ¼ä£º
//µÚÒ»¸ö±íʾִÐеÄʱ¼ä£¬µÚ¶þ¸ö±íʾ¸ô¶à³¤Ê±¼äÖ´ÐС£
timer.schedule(new MyTask(), new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse("2010-5-31 18:23:50"), 2000);
timer.schedule(new MyTask(), 1000, 2000);//ÔÚ1ÃëºóÖ´ÐдËÈÎÎñ,ÿ´Î¼ä¸ô2Ãë,Èç¹û´«µÝÒ»¸öData²ÎÊý,¾Í¿ÉÒÔÔÚij¸ö¹Ì¶¨µÄʱ¼äÖ´ÐÐÕâ¸öÈÎÎñ.
while(true){//Õâ¸öÊÇÓÃÀ´Í£Ö¹´ËÈÎÎñµÄ,·ñÔò¾Íһֱѻ·Ö´ÐдËÈÎÎñÁË
try {
int ch = System.in.read();
if(ch-'c'==0){
timer.cancel();//ʹÓÃÕâ¸ö·½·¨Í˳öÈÎÎñ
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
static class MyTask extends java.util.TimerTask{
@Override
public void run() {
// TODO Auto-generated method stub
System.out.println("________");
}
}
}
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/sunny3106/archive/2007/05/17/1612952.aspx
Ïà¹ØÎĵµ£º
×î½ü¹«Ë¾Åöµ½ÐèÒªÓÃͼ±íµÄÐÎʽÏÔʾһЩÊý¾Ý£¬ÎҾͿªÊ¼µ½ÍøÉϲéѯ£¬²éµ½ÁËjfreechartºÍamcharts,ÕâÁ½ÕßÎÒ¶¼ÊµÏÖ¹ýÁË£¬jfreechart×îºóÉú³ÉͼƬ£¬µ«ÊÇͼƬЧ¹û²»ÊÇÎÒÏëÒªµÄ£¬È»ºóÓÖÑо¿amcharts ËüµÄЧ¹ûȷʵºÜºÃ£¬¶øÇÒ¹Ù·½ÍøÕ¾ÉÏ»¹ÓкÃЩÀý×ӿɹ©ÏÂÔØ£¬ÍøÖ·ÊÇ:www.amcharts.com
£¨ÏëÒªÍê³ÉÒ»¸öamchartsͼÐÎÐèÒªswfobjects. ......
JavaÖеÄ×Ö·û´®Ò²ÊÇÒ»Á¬´®µÄ×Ö·û¡£µ«ÊÇÓëÐí¶àÆäËûµÄ¼ÆËã»úÓïÑÔ½«×Ö·û´®×÷Ϊ×Ö·ûÊý×é´¦Àí²»Í¬£¬Java½«×Ö·û´®×÷ΪStringÀàÐͶÔÏóÀ´´¦Àí¡£½«×Ö·û´®×÷ΪÄÚÖõĶÔÏó´¦ÀíÔÊÐíJavaÌṩʮ·Ö·á¸»µÄ¹¦ÄÜÌØÐÔÒÔ·½±ã´¦Àí×Ö·û´®¡£ÏÂÃæÊÇһЩʹÓÃÆµÂʱȽϸߵĺ¯Êý¼°ÆäÏà¹ØËµÃ÷¡£
substring()
ËüÓÐÁ½ÖÖÐÎʽ£¬µÚÒ»ÖÖÊÇ£ºString substring( ......
ÎÄÖÐjstat²¿·Öת×Ô
http://blog.csdn.net/kozazyh/archive/2010/02/04/5289684.aspx
ÓÃjavaÓïÑÔ±à³ÌµÄʱºò£¬sunÌṩÁ˼¸¸öС¹¤¾ß£¬ÓÃ×Å»¹ÊDz»´íµÄ£¬ÌØÒâ×öÏÂ×ܽá
1.jps
jpsÓÃÀ´²é¿´µ±Ç°javaµÄ½ø³Ì£¬ÆäʵËüµÄ¹¦ÄÜ¿ÉÒÔ»ù±¾ÉÏÓÉpsÀ´ÊµÏÖ
¼¸¸ö³£ÓõIJÎÊý£º
-q Ö»ÏÔʾpid£¬²»ÏÔʾclassÃû³Æ,jarÎļþÃûºÍ´«µÝ¸ømain ·½·¨µÄ²Î ......
ÕâÀï×ªÔØÒ»Æª½²½âjavaÐòÁл¯(Serializable)ºÍ·´ÐòÁл¯·½ÃæµÄ¸Ð¾õºÜºÃµÄÎÄÕ¡£
1¡¢ÐòÁл¯ÊǸÉʲôµÄ£¿
¼òµ¥Ëµ¾ÍÊÇΪÁ˱£´æÔÚÄÚ´æÖеĸ÷ÖÖ¶ÔÏóµÄ״̬£¨Ò²¾ÍÊÇʵÀý±äÁ¿£¬²»ÊÇ·½·¨£©£¬²¢ÇÒ¿ÉÒ԰ѱ£´æµÄ¶ÔÏó״̬ÔÙ¶Á³öÀ´¡£ËäÈ»Äã¿ÉÒÔÓÃÄã×Ô¼ºµÄ¸÷ÖÖ¸÷ÑùµÄ·½·¨À´±£ ´æobject states£¬µ«ÊÇJava¸øÄãÌṩһÖÖÓ¦¸Ã±ÈÄã×Ô¼ººÃµÄ±£´æ ......
TIOBE
µÄ
±à³ÌÓïÑÔÅÅÃû°ñ£¬Ïë±Ø´ó¼Ò¶¼·Ç³£ÊìϤ£¬Ã¿Ô·¢²¼È«Çò±à³ÌÓïÑÔµÄÈȶȺÍÇ÷ÊÆ¡£ÔÚËÄÔ·ݷ¢²¼µÄÊý¾ÝÖУ¬CÓïÑÔÖÕÓÚ³¬¹ýJava³ÉΪNo.1£¬µ«ÕæÕýÈÃÈ˵£ÓÇ
µÄ£¬²¢²»ÊÇCµÄ¶á¹Ú£¬¶øÊÇJavaµÄ³ÖÐøÆ£Èõ£¬¸üÔã¸âµÄÊÇ£¬ËƺõûÓÐÄĸöÀÏ´óÕ¾³öÀ´Íì¾ÈÍÇÊÆ¡£
×÷ΪһÃûJava´ÓÒµÕߣ¬ÎÒÔÚÆóÒµÓ¦ÓÃÁìÓò×öÈí¼þ£¬´Ó¹¤×÷Öв¢Î´¸ÐÊܵ½Javaµ ......