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

JavaÏß³ÌÐÂÌØÕ÷ Ï̳߳Ø

SunÔÚJava5ÖУ¬¶ÔJavaÏ̵߳ÄÀà¿â×öÁË´óÁ¿µÄÀ©Õ¹£¬ÆäÖÐÏ̳߳ؾÍÊÇJava5µÄÐÂÌØÕ÷Ö®Ò»£¬³ýÁËÏ̳߳ØÖ®Í⣬»¹Óкܶà¶àÏß³ÌÏà¹ØµÄÄÚÈÝ£¬Îª¶àÏ̵߳ıà³Ì´øÀ´Á˼«´ó±ãÀû¡£ÎªÁ˱àд¸ßЧÎȶ¨¿É¿¿µÄ¶àÏ̳߳ÌÐò£¬Ï̲߳¿·ÖµÄÐÂÔöÄÚÈÝÏÔµÃÓÈΪÖØÒª¡£
 
ÓйØJava5Ïß³ÌÐÂÌØÕ÷µÄÄÚÈÝÈ«²¿ÔÚjava.util.concurrentÏÂÃ棬ÀïÃæ°üº¬ÊýÄ¿ÖÚ¶àµÄ½Ó¿ÚºÍÀ࣬ÊìϤÕⲿ·ÖAPIÌØÕ÷ÊÇÒ»Ïî¼èÄѵÄѧϰ¹ý³Ì¡£Ä¿Ç°ÓйØÕâ·½ÃæµÄ×ÊÁϺÍÊé¼®¶¼ÉÙÖ®ÓÖÉÙ£¬´óËùÊô½éÉÜÏ̷߳½ÃæÊé¼®»¹Í£ÁôÔÚjava5֮ǰµÄ֪ʶ²ãÃæÉÏ¡£
 
µ±È»ÐÂÌØÕ÷¶Ô×ö¶àÏ̳߳ÌÐòûÓбØÐëµÄ¹Øϵ£¬ÔÚjava5֮ǰͨÓÿÉÒÔд³öºÜÓÅÐãµÄ¶àÏ̳߳ÌÐò¡£Ö»ÊÇ´ú¼Û²»Ò»Ñù¶øÒÑ¡£
 
Ï̳߳صĻù±¾Ë¼Ï뻹ÊÇÒ»ÖÖ¶ÔÏó³ØµÄ˼Ï룬¿ª±ÙÒ»¿éÄÚ´æ¿Õ¼ä£¬ÀïÃæ´æ·ÅÁËÖڶࣨδËÀÍö£©µÄỊ̈߳¬³ØÖÐÏß³ÌÖ´Ðе÷¶ÈÓɳعÜÀíÆ÷À´´¦Àí¡£µ±ÓÐÏß³ÌÈÎÎñʱ£¬´Ó³ØÖÐÈ¡Ò»¸ö£¬Ö´ÐÐÍê³ÉºóÏ̶߳ÔÏó¹é³Ø£¬ÕâÑù¿ÉÒÔ±ÜÃâ·´¸´´´½¨Ï̶߳ÔÏóËù´øÀ´µÄÐÔÄÜ¿ªÏú£¬½ÚÊ¡ÁËϵͳµÄ×ÊÔ´¡£
 
ÔÚJava5֮ǰ£¬ÒªÊµÏÖÒ»¸öÏ̳߳ØÊÇÏ൱ÓÐÄѶȵģ¬ÏÖÔÚJava5ΪÎÒÃÇ×öºÃÁËÒ»ÇУ¬ÎÒÃÇÖ»ÐèÒª°´ÕÕÌṩµÄAPIÀ´Ê¹Ó㬼´¿ÉÏíÊÜÏ̳߳شøÀ´µÄ¼«´ó±ãÀû¡£
 
Java5µÄÏ̳߳طֺöàÖÖ£º¹Ì¶¨³ß´çµÄÏ̳߳ء¢¿É±ä³ß´çÁ¬½Ó³Ø¡¢¡£
 
ÔÚʹÓÃÏ̳߳Ø֮ǰ£¬±ØÐëÖªµÀÈçºÎÈ¥´´½¨Ò»¸öÏ̳߳أ¬ÔÚJava5ÖУ¬ÐèÒªÁ˽âµÄÊÇjava.util.concurrent.ExecutorsÀàµÄAPI£¬Õâ¸öÀàÌṩ´óÁ¿´´½¨Á¬½Ó³ØµÄ¾²Ì¬·½·¨£¬ÊDZØÐëÕÆÎյġ£
 
Ò»¡¢¹Ì¶¨´óСµÄÏ̳߳Ø
 
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
/**
* JavaỊ̈߳ºÏ̳߳Ø-
*
* @author Administrator 2009-11-4 23:30:44
*/
public class Test {
public static void main(String[] args) {
//´´½¨Ò»¸ö¿ÉÖØÓù̶¨Ïß³ÌÊýµÄÏ̳߳Ø
ExecutorService pool = Executors.newFixedThreadPool(2);
//´´½¨ÊµÏÖÁËRunnable½Ó¿Ú¶ÔÏó£¬Thread¶ÔÏóµ±È»Ò²ÊµÏÖÁËRunnable½Ó¿Ú
Thread t1 = new MyThread();
Thread t2 = new MyThread();
Thread t3 = new MyThread();
Thread t4 = new MyThread();
Thread t5 = new MyThread();
//½«Ï̷߳ÅÈë³ØÖнøÐÐÖ´ÐÐ
pool.execute(t1);
pool.execute(t2);
pool.execute(t3);
pool.execute(t4);
pool.execute(t5);
//¹Ø±ÕÏ̳߳Ø
pool.shutdown();
}
}
class MyThread extends Thread{
@Override
public void


Ïà¹ØÎĵµ£º

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 ÖеÄÑéÖ¤Âë

<%@ page language="java" import="java.util.*" pageEncoding="GBK"
 import="java.awt.*,java.awt.image.*,javax.imageio.*"%><%
/*
ʹÓ÷½·¨£ºÔÚÐèÒªÏÔʾÑéÖ¤ÂëµÄhtml´úÂëÖÐʹÓÃ<img p">
  ÔÚÐèÅжÏsessionµÄʱºòÅжÏsession.getAttribute("vcode")
*/try{
  int codeLength=4;//Ñé ......

javaÐéÄâ»úÔ´´úÂë ÉîδÀ´¼¼Êõ

±¾Õ¾(openjdk)ÏÖÔÚËùÁгöÀ´µÄ¾ÍÊÇHotSpotÐéÄâ»úµÄÔ´´úÂ룬¶øHotSpotÕýÊÇÄ¿Ç°ÊÀ½çÉÏjavaÐéÄâ»úµÄ×îºÃµÄʵÏÖ¡£
¡¡¡¡HotSpotµÄ»ù´¡´úÂëÊÇÐí¶àÈËÐÁÇÚÀͶ¯µÄ½á¾§£¬Õâ¸ö¹ý³ÌÆù½ñÒѳÖÐøÁ˳¬¹ý10ÄêµÄʱ¼ä£¨µ±È»Ê±¼ä³¤²¢²»Òâζ×ÅÒ»¶¨ºÃ£¬Ò»°ëÒ»°ë°É£©¡£ËùÒÔµ½ÏÖÔÚΪֹ£¬ËûµÄÌå»ýÊǺܴóµÄ¡£Óн«½ü1500¸öC/C++Í·ÒýÓúÍÔ´´úÂëÎļþ£¬Õû¸ ......

´«ÖDz¥¿Í——AWT£ºjava¼òªµÄͼÐλ¯Éè¼Æ

Ò»£º java.awt°ü
¡¡¡¡  java.awt°üÖÐÌṩÁËGUIÉè¼ÆËùʹÓõÄÀàºÍ½Ó¿Ú£¬¿É´ÓÖп´µ½Ö÷ÒªÀàÖ®¼äµÄ¹Øϵ¡£
¡¡    java.awt°üÌṩÁË»ù±¾µÄjava³ÌÐòµÄGUIÉè¼Æ¹¤¾ß¡£Ö÷Òª°üÀ¨ÏÂÊöÈý¸ö¸ÅÄ
¡¡¡¡  ×é¼þ--Component
¡¡¡¡  ÈÝÆ÷--Container
¡¡¡¡  ²¼¾Ö¹ÜÀíÆ÷--LayoutManager
¶þ£º  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ