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

java¶àÏ̱߳à³ÌÒªµã(¶þ)

4¡¢  TimerºÍTimerTaskµÄʹÓÃ
       TimerÊÇÒ»ÖÖ¶¨Ê±Æ÷¹¤¾ß£¬ÓÃÀ´ÔÚÒ»¸öºǫ́Ï̼߳ƻ®Ö´ÐÐÖ¸¶¨ÈÎÎñ£¬ÕâЩÈÎÎñ¿ÉÒÔ±»Ö´ÐÐÒ»´Î£¬Ò²¿ÉÒÔ±»¶¨ÆÚÖ´ÐС£Ã¿¸ö Timer ¶ÔÏó¶ÔÓ¦Ò»¸öºǫ́Ị̈߳¬Ë³ÐòµØÖ´ÐÐËùÓмÆʱÆ÷ÈÎÎñ¡£Èç¹ûÍê³Éij¸ö¼ÆʱÆ÷ÈÎÎñµÄʱ¼äÌ«³¤£¬ÄÇôËü»á“¶ÀÕ¼”¼ÆʱÆ÷µÄÈÎÎñÖ´ÐÐỊ̈߳¬´Ó¶ø¿ÉÄÜÑÓ³ÙºóÐøÈÎÎñµÄÖ´ÐС£¶Ô Timer ¶ÔÏó×îºóµÄÒýÓÃÍê³É²¢ÇÒËùÓÐδ´¦ÀíµÄÈÎÎñ¶¼ÒÑÖ´ÐÐÍê³Éºó£¬¼ÆʱÆ÷µÄÈÎÎñÖ´ÐÐÏ̻߳áÕý³£ÖÕÖ¹£¨²¢ÇÒ³ÉΪÀ¬»ø»ØÊյĶÔÏ󣩡£TimerTaskÊÇÒ»¸ö³éÏóÀ࣬ʵÏÖÁËRunable½Ó¿Ú£¬ËüµÄ×ÓÀà´ú±íÒ»¸ö¿ÉÒÔ±»Timer¼Æ»®µÄÈÎÎñ¡£csdnÉÏÁíÍâһƪ²©ÎÄ£ºhttp://blog.csdn.net/siyue_qi/archive/2008/05/22/2469316.aspx£¬±È½ÏÏêϸµÄ²ûÊöÁËTimerºÍTimerTaskµÄʹÓá£
1£©  Ò»¸ö¼òµ¥µÄDemo£¬Èôó¼Ò¶ÔTimer¡¢TimerTaskµÄʹÓÃÓиÐÐÔµÄÈÏʶ¡£
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(), 1000, 2000);//ÔÚ1ÃëºóÖ´ÐдËÈÎÎñ,ÿ´Î¼ä¸ô2Ãë
        while(true){//Õâ¸öÊÇÓÃÀ´Í£Ö¹´ËÈÎÎñµÄ,·ñÔò¾Íһֱѭ»·Ö´ÐдËÈÎÎñÁË
            try {
                int ch = System.in.read();
                if(ch-'c'==0){
                    timer.cancel();//ʹÓÃÕâ¸ö·½·¨Í˳öÈÎÎñ
                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
       &n


Ïà¹ØÎĵµ£º

Ò»µÀ¼òµ¥µÄjavaÌ⣬ȷ·ÑÁËÎÒͦ³¤Ê±¼äµÄ¡£

½ñÈÕÔÚÍøÉÏżȻÅöµ½Ò»¸ö³õѧÕßµÄjavaÌâÄ¿£¬¾Í³¢ÊÔµÄ×öÁËһϣ¬µ«Ã»Ïëµ½Ò»×ö¾ÍÊǽӽüÒ»¸öÖÓÍ·°¡£¬¿´À´javaѧϰµÄ·ÉÏ»¹ÊÇ·ÂþÂþÙâÐÞÔ¶°¡¡£
 ÌâÄ¿ÈçÏ£º
±àдһ¸öJava Application ³ÌÐò£¬½ÓÊÜÓû§ÊäÈëµÄÒ»¸ö¸¡µãÊý£¬½«ÆäµÄÕûÊý²¿·ÖºÍСÊý²¿·Ö·Ö±ðÊä³ö¡£
È磺ÊäÈë56.6 £¬ÔòÓÐ
¡¡¡¡¡¡¡¡¡¡¡¡ÕûÊý²¿·Ö£º56
¡¡¡¡¡¡¡¡¡¡¡¡ ......

Java XStream·â×°Àà

´Ë¸öÀàÊÇΪÁË·½±ã³õѧÕ߶ÔXMLµ½ javabean µÄÏ໥ת»»²»ÊìϤ¶øдµÄ:
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
public class XmlBean {
 /*
  * @AUTHOR:ZHONG
  * @CREATETIME:2010/02/10
  * @PREAM:OBJECT(JAVABEAN)
  * @RETURN:X ......

HowTo Install Java on CentOS 4 and CentOS 5

http://writeblog.csdn.net/PostEdit.aspx?entryId=5305099
Contents
Preliminary material
Method One: A simple approach
Method Two: A less simple approach
Java for the desktop user
Java for the developer and the server environment
Requirements
Step 1. Initial setup
Step 2. Installing your favor ......

˵µØµÀµÄJavaÓïÑÔ

ʹÓÃÒ»ÖÖ³ÌÐòÉè¼ÆÓïÑÔ£¬¾ÍÓ¦¸ÃרҵµØʹÓÃËü¡£±¾ÎÄÊÇIBM developerWorksÖеÄһƪÎÄÕ£¬ËüÃèÊöµÄ¶¼ÊÇJava±à³ÌÖеÄϸ½ÚÎÊÌ⣬¾¡¹ÜÈç´Ë£¬»¹ÊÇÖµµÃ´ó¼ÒÍæζһ·¬£¬ÖÁÉÙÎÒ×÷ΪһÃûÀÏÄñ»¹ÊÇ´ÓÖÐÊÜÒæÁË¡£(2010.02.09×îºó¸üÐÂ)
    ѧϰһÖÖеijÌÐòÉè¼ÆÓïÑÔ±ÈѧϰһÖÖеĿÚÍ·ÓïÑÔÒªÈÝÒס£µ«ÊÇ£¬ÔÚÕâÁ½ÖÖŬÁ¦ÖУ¬¶¼Ð ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ