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

javaµÄ»Øµ÷¼¼Êõdz̸

ÎÒÃǾ­³£»áÓÃSystem.currentTimeMillis()ÔÚʼþ¿ªÊ¼Ç°ºÍ½áÊøºóÉèÖÃÒ»¸ö¿ªÊ¼Ê±¼äºÍ½áÊøʱ¼ä£¬ÓÃËûÃǵIJî×÷Ϊ³ÌÐòÖ´ÐеÄʱ¼ä¡£
ÎÒÃDz»·Á¶¨ÒåÒ»¸ö½Ó¿ÚÓÃjava»Øµ÷À´ÊµÏÖ¶¯Ì¬¼ÆËã¡£
½Ó¿Ú¶¨Ò壺
package com.hd123.h5.ejb.verctrl;
public interface CallBack {
  public void callBack();
}
È»ºóÊÇʵÏÖÕâ¸ö½Ó¿Ú
package com.hd123.h5.ejb.verctrl;
public class Run {
  //ÓÉÓÚ½Ó¿ÚÖÐµÄ callBack·½·¨ÊÇûÓж¨ÒåµÄ£¬ËùÒÔÓÃÒ»¸ö½Ó¿Ú¶ÔÏóÖ´ÐÐcallBack()·½·¨£¬ÆäʵÊÇδ֪µÄ£¬ÎÒÃǾßÌåÐèҪʵÏֵķ½·¨
  //¿ÉÒÔͨ¹ýcallBack()£¬Õâ¸ö·½·¨µÄ²»Í¬ÊµÏÖÀ´ÊµÏÖ¶¯Ì¬¼Æʱ¡£
  private void run(CallBack callBack, String event) {
    long startTime = System.currentTimeMillis();
    callBack.callBack();
    long endTime = System.currentTimeMillis();
    System.out.print("Ö´ÐÐ" + event + "¹²ÏûºÄ" + (endTime - startTime) + "ms");
  }
  public static void main(String[] args) {
    Run r=new Run();
//ÕâÀﶯ̬µÄʵÏÖcallBack·½·¨¡£
    r.run(new CallBack(){
      public void callBack() {
        for(int i=0;i<999;i++){
          for(int j=i+1;j<99999;j++){
          }
        }
      }
     
    }, "Ñ­»·");
  }
}


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

javaʹÓÃrocksawºÍvserv tcpipʵÏÖ»ùÓÚICMPµÄPing¹¦ÄÜ

Ò»£º×¼±¸ www.savarese.org download
 1.  rocksaw-1.0.0-src.tar.gz
 2.  vserv-tcpip-0.9.2-src.tar.gz
¶þ£º±àÒëÔ´ÎļþµÃµ½jar°ü ʹÓÃAnt
 1.  build vserv-tcpip-0.9.2-src
      ÔÚvserv-tcpip-0.9.2Ŀ¼ÏÂÃ潨һ¸ötestsĿ¼£¬È»ºóÔÚcmd´°¿ÚϽøÈë ......

JavaÖеÄ23ÖÖÉè¼Æģʽ

  1¡¢¹¤³§Ä£Ê½£º¿Í»§ÀàºÍ¹¤³§Àà·Ö¿ª¡£Ïû·ÑÕßÈκÎʱºòÐèҪijÖÖ²úÆ·£¬Ö»ÐèÏò¹¤³§ÇëÇó¼´¿É¡£Ïû·ÑÕßÎÞÐëÐ޸ľͿÉÒÔ½ÓÄÉвúÆ·¡£È±µãÊǵ±²úÆ·ÐÞ¸Äʱ£¬¹¤³§ÀàÒ²Òª×öÏàÓ¦µÄÐ޸ġ£È磺ÈçºÎ´´½¨¼°ÈçºÎÏò¿Í»§¶ËÌṩ¡£  
¡¡¡¡2¡¢½¨Ôìģʽ£º½«²úÆ·µÄÄÚ²¿±íÏóºÍ²úÆ·µÄÉú³É¹ý³Ì·Ö¸î¿ªÀ´£¬´Ó¶øʹһ¸ö½¨Ôì¹ý³ÌÉú³É¾ßÓв»Í¬µ ......

javaÖÐmap¼¯ºÏµÄÓ÷¨


http://blog.csdn.net/ycyangcai/archive/2009/06/21/4285997.aspx
1.ÉùÃ÷Ò»¸ömap: Map map = new HashMap(); 
2.ÏòmapÖзÅÖµ,×¢Ò⣺mapÊÇkey-valueµÄÐÎʽ´æ·ÅµÄ.Èç:
     map.put("sa","dd");
3.´ÓmapÖÐÈ¡Öµ:String str = map.get("sa").toString();½á¹ûÊÇ:str = "dd";
4.±éÀúÒ»¸ömap£¬´Ó ......

C++ÓëJavaµÄÇø±ðÏê½â:

1.JavaÔÚÐéÄâ»úÉÏÔËÐР
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·­Òë³ÉΪÐéÄâ»ú¿ÉÒÔÖ´ÐеĴúÂë¡£Ò»¸öJava½âÊÍÆ÷×îÖÕÖ´ÐÐÕâЩ´úÂë¡£ÕâÆäÖÐûÓÐÁ¬½ÓµÄ¹ý³Ì£»½âÊÍÔÚÐèÒªµÄʱºò¶¯Ì¬µÄ¼ÓÔØһЩÀࣻ 
2.JavaÊÇÍêÈ«ÃæÏò¶ÔÏóµÄ 
JavaÊÇÒ»ÖÖÍêÈ«ÃæÏò¶ÔÏóµÄÓïÑÔ¡£ÕâÒâζ×ÅÄã¶ÔÈκÎÒ»¸öJava¶ÔÏóËù×öµÄ¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ