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

Java¶àÏ̵߳ÄÏà¹Ø»úÖÆ[z]

 Ò» Ï̵߳Ļù±¾¸ÅÄî
Ïß³ÌÊÇÒ»¸ö³ÌÐòÄÚ²¿µÄ˳Ðò¿ØÖÆÁ÷.Ò»¸ö½ø³ÌÏ൱ÓÚÒ»¸öÈÎÎñ,Ò»¸öÏß³ÌÏ൱ÓÚÒ»¸öÈÎÎñÖеÄÒ»ÌõÖ´Ðз¾¶.£»¶à½ø³Ì:ÔÚ²Ù×÷ϵͳÖÐÄÜͬʱÔËÐжà¸öÈÎÎñ (³ÌÐò)£»¶àÏß³Ì:ÔÚͬһ¸öÓ¦ÓóÌÐòÖÐÓжà¸ö˳ÐòÁ÷ͬʱִÐУ»JavaµÄÏß³ÌÊÇͨ¹ýjava.lang.ThreadÀàÀ´ÊµÏֵģ»JVMÆô¶¯Ê±»áÓÐÒ»¸öÓÉÖ÷·½·¨(public static void main(){})Ëù¶¨ÒåµÄỊ̈߳»¿ÉÒÔͨ¹ý´´½¨ThreadµÄʵÀýÀ´´´½¨ÐµÄỊ̈߳»Ã¿¸öÏ̶߳¼ÊÇͨ¹ýij¸öÌض¨Thread¶ÔÏóËù¶ÔÓ¦µÄ·½·¨run()À´Íê³ÉÆä²Ù×÷µÄ,·½·¨run()³ÆΪÏß³ÌÌ壬ͨ¹ýµ÷ÓÃThreadÀàµÄstart()·½·¨À´Æô¶¯Ò»¸öÏ̡߳£
¶þ Ï̵߳Ĵ´½¨ºÍÆô¶¯
¿ÉÒÔÓÐÁ½ÖÖ·½Ê½´´½¨ÐµÄÏß³Ì:
µÚÒ»ÖÖ:
1.¶¨ÒåÏß³ÌÀàʵÏÖRunnable½Ó¿Ú
2.Thread myThread = new Thread(target);   //targetΪRunnable½Ó¿ÚÀàÐÍ
3.RunnableÖÐÖ»ÓÐÒ»¸ö·½·¨:public void run();ÓÃÒÔ¶¨ÒåÏß³ÌÔËÐÐÌå
4.ʹÓÃRunnable½Ó¿Ú¿ÉÒÔΪ¶à¸öÏß³ÌÌṩ¹²ÏíµÄÊý¾Ý
5.ÔÚʵÏÖRunnable½Ó¿ÚµÄÀàµÄrun()·½·¨¶¨ÒåÖпÉÒÔʹÓÃThreadµÄ¾²Ì¬·½·¨public static Thread currentThread();»ñÈ¡µ±Ç°Ï̵߳ÄÒýÓÃ
µÚ¶þÖÖ:
1.¿ÉÒÔ¶¨ÒåÒ»¸öThreadµÄ×ÓÀಢÖØдÆärun·½·¨Èç:
class MyThread extends Thread {   
public void run() {...}
}   
2.È»ºóÉú³É¸ÃÀàµÄ¶ÔÏó:
MyThread myThread = new MyThread();
Èý Ï߳̿ØÖƵĻù±¾·½·¨
isAlive():ÅжÏÏß³ÌÊÇ·ñ»¹"»î"×Å
getPriority():»ñµÃÏ̵߳ÄÓÅÏȼ¶ÊýÖµ
setPriority():ÉèÖÃÏ̵߳ÄÓÅÏȼ¶ÊýÖµ
Thread.sleep():½«µ±Ç°Ïß³Ì˯ÃßÖ¸¶¨ºÁÃëÊý
join():µ÷ÓÃijÏ̵߳ĸ÷½·¨,½«µ±Ç°Ïß³ÌÓë¸ÃÏß³Ì"ºÏ²¢",¼´µÈ´ý¸ÃÏ߳̽áÊø,ÔÙ»Ö¸´µ±Ç°Ï̵߳ÄÔËÐÐ
yield():Èóöcpu,µ±Ç°Ï߳̽øÈë¾ÍÐ÷¶ÓÁеȴýµ÷¶È
wait():µ±Ç°Ï߳̽øÈë¶ÔÏóµÄwait pool
notify()/notifyAll():»½ÐѶÔÏóµÄwait poolÖеÄÒ»¸ö/ËùÓеȴýÏß³Ì
Ò» Ï̵߳Ļù±¾¸ÅÄî
Ïß³ÌÊÇÒ»¸ö³ÌÐòÄÚ²¿µÄ˳Ðò¿ØÖÆÁ÷.Ò»¸ö½ø³ÌÏ൱ÓÚÒ»¸öÈÎÎñ,Ò»¸öÏß³ÌÏ൱ÓÚÒ»¸öÈÎÎñÖеÄÒ»ÌõÖ´Ðз¾¶.£»¶à½ø³Ì:ÔÚ²Ù×÷ϵͳÖÐÄÜͬʱÔËÐжà¸öÈÎÎñ (³ÌÐò)£»¶àÏß³Ì:ÔÚͬһ¸öÓ¦ÓóÌÐòÖÐÓжà¸ö˳ÐòÁ÷ͬʱִÐУ»JavaµÄÏß³ÌÊÇͨ¹ýjava.lang.ThreadÀàÀ´ÊµÏֵģ»JVMÆô¶¯Ê±»áÓÐÒ»¸öÓÉÖ÷·½·¨(public static void main(){})Ëù¶¨ÒåµÄỊ̈߳»¿ÉÒÔͨ¹ý´´½¨ThreadµÄʵÀýÀ´´´½¨ÐµÄỊ̈߳»Ã¿¸öÏ̶߳¼ÊÇͨ¹ýij¸öÌض¨Thread¶ÔÏóËù¶ÔÓ¦µÄ·½·¨run()À´Íê³ÉÆä²Ù×÷µÄ,·½·¨run()³ÆΪÏß³ÌÌ壬ͨ¹ýµ÷ÓÃThreadÀàµÄstart()·½·¨À´Æô¶¯Ò»¸öÏ̡߳£


Ïà¹ØÎĵµ£º

Java¼¯ÈºÖ®session¹²Ïí½â¾ö·½°¸

      Ëæ×Å»¥ÁªÍøµÄÈÕÒæ׳´ó,ÍøÕ¾µÄpvºÍuv³ÉÏßÐÔ»òÕßÖ¸Êý±¶µÄÔö¼Ó.µ¥·þÎñÆ÷µ¥Êý¾Ý¿âÔçÒѾ­²»ÄÜÂú×ãʵ¼ÊÐèÇó.±ÈÈçÏñÊ¢´ó,ÌÔ±¦ÕâÑùµÄ´óÐÍÍøÂ繫˾,¸üÊÇÈç´Ë.
    ¼¯Èº,Ò²¾ÍÊÇÈÃÒ»×é¼ÆËã»ú·þÎñÆ÷Эͬ¹¤×÷,´ï½â¾ö´ó²¢·¢,´óÊý¾ÝÁ¿Æ¿¾±ÎÊÌâ.µ«ÊÇÔÚȺ¼¯ÖÐ,sessionÍùÍùÊÇÒ»¸ö±È½ÈÍ·ÌÛµÄÎ ......

µÚÒ»¸öjavaµÄApplet

 ×î½ü¿ªÊ¼ÔÚ¿´java£¬¶ÔAppletÕâ½Ú±È½Ï¸ÐÐËȤ£¬¸ÄÁ˸ÄÊéÉϵĴúÂ룬Ȩµ±Áô¸öÓ¡¼Ç
import java.awt.*;
import java.applet.*;
public class HelloApplet extends Applet
{
Font f1 = new Font("Times New Roman", Font.PLAIN, 12);
Font f2 = new Font("ËÎÌå", Font.BOLD, 24);
Font f3 = new Font("ºÚÌå", Fon ......

java nio Ö®MappedByteBuffer

 
ÆäʵÕÆÎÕ
MappedByteBuffer
²¢²»ÄÑ£¬Ö»Òª¼Çס“Èý·½Èý·¨ÈýÌØÐÔ”£¨ÎÒ×Ô¼º×ܽáµÄ£¬ºÇºÇ
~~
²»ÒªÈÓ¼¦µ°Å¶¡£¡£¡££©Õâ¾ä»°¾Í¿ÉÒÔÇáËɸ㶨£¡
MappedByteBuffer
Ö»ÊÇÒ»ÖÖÌØÊâµÄ
ByteBuffer
£¬¼´ÊÇ
ByteBuffer
µÄ×ÓÀà¡£
MappedByteBuffer
½«ÎļþÖ±½ÓÓ³Éäµ½Äڴ棨ÕâÀïµÄÄÚ´æÖ¸µÄÊÇÐéÄâÄڴ棬²¢² ......

javaµ÷Óô洢¹ý³Ì£¨jdbc & hibernate£©

Ò»¡¢JDBCµ÷Óô洢¹ý³Ì
creat proc proc_select
¡¡¡¡@pid varchar(20)
¡¡¡¡@address varchar(20) output
¡¡¡¡as
¡¡¡¡select @address=address from userinfo where pid=@pid
¡¡¡¡go
¡¡¡¡ÓÃjavaµ÷ÓÃ:
¡¡¡¡class.forName(\"sun.jdbc.odbc.JdbcOdbcDriver\"); //¼ÓÔØÇý¶¯
¡¡¡¡Connection con=DriverManager.ge ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ