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

Java¶àÏß³ÌʵÏÖÒì²½µ÷ÓÃ

ÔÚJAVAƽ̨,ʵÏÖÒì²½µ÷ÓõĽÇÉ«ÓÐÈçÏÂÈý¸ö½ÇÉ«:µ÷ÓÃÕß Ìá»õµ¥ ÕæʵÊý¾Ý
Ò»¸öµ÷ÓÃÕßÔÚµ÷ÓúÄʱ²Ù×÷,²»ÄÜÁ¢¼´·µ»ØÊý¾Ýʱ,ÏÈ·µ»ØÒ»¸öÌá»õµ¥.È»ºóÔÚ¹ýÒ»¶Ïʱ¼äºóƾÌá»õµ¥À´»ñÈ¡ÕæÕýµÄÊý¾Ý.
È¥µ°¸âµêÂòµ°¸â£¬²»ÐèÒªµÈµ°¸â×ö³öÀ´£¨¼ÙÉèÏÖ×öÒªºÜ³¤Ê±¼ä£©£¬Ö»ÐèÒªÁì¸öÌá»õµ¥¾Í¿ÉÒÔÁË£¨È¥¸É±ðµÄÊÂÇ飩£¬µÈµ½µ°¸â×öºÃÁË£¬ÔÙÄÃÌá»õµ¥È¡µ°¸â¾Í¿ÉÒÔÁË¡£
public class Main {
public static void main(String[] args) {
System.out.println("main BEGIN");
Host host = new Host();
Data data1 = host.request(10, 'A');
Data data2 = host.request(20, 'B');
Data data3 = host.request(30, 'C');
System.out.println("main otherJob BEGIN");
try {
Thread.sleep(200);
} catch (InterruptedException e) {
}
System.out.println("main otherJob END");
System.out.println("data1 = " + data1.getContent());
System.out.println("data2 = " + data2.getContent());
System.out.println("data3 = " + data3.getContent());
System.out.println("main END");
}
}
ÕâÀïµÄmainÀà¾ÍÏ൱ÓÚ“¹Ë¿Í”£¬host¾ÍÏ൱ÓÚ“µ°¸âµê”£¬¹Ë¿ÍÏò“µ°¸âµê”¶¨µ°¸â¾ÍÏ൱ÓÚ“·¢ÇëÇórequest”£¬·µ»ØµÄÊý¾ÝdataÊÇFutureDataµÄʵÀý£¬¾ÍÏ൱ÓÚÌá»õµ¥£¬¶ø²»ÊÇÕæÕýµÄ“µ°¸â”¡£ÔÚ¹ýÒ»¶Îʱ¼äºó£¨sleepÒ»¶Îʱ¼äºó£©£¬µ÷ÓÃdata1.getContent()£¬Ò²¾ÍÊÇÄÃÌá»õµ¥»ñÈ¡Ö´Ðнá¹û¡£
ÏÂÃæÀ´¿´Ò»Ï£¬¹Ë¿Í¶¨µ°¸âºó£¬µ°¸âµê×öÁËʲô£º
public class Host {
public Data request(final int count, final char c) {
System.out.println("request(" + count + ", " + c + ") BEGIN");
// (1) ½¨Á¢FutureDataµÄʵÌå
final FutureData future = new FutureData();
// (2) ΪÁ˽¨Á¢RealDataµÄʵÌ壬Æô¶¯ÐµÄÏß³Ì
new Thread() {
public void run() {
//ÔÚÄäÃûÄÚ²¿ÀàÖÐʹÓÃcount¡¢future¡¢c¡£
RealData realdata = new RealData(count, c);
future.setRealData(realdata);
}
}.start();
System.out.println("request(" + count + ", " + c + ") END");
// (3) È¡»ØFutureDataʵÌ壬×÷Ϊ´«»ØÖµ
return future;
}
}
host("µ°¸âµê")ÔÚ½Óµ½ÇëÇóºó£¬ÏÈÉú³ÉÁË“Ìá»õµ¥”FutureDataµÄʵÀýfuture£¬È»ºóÃüÁ°¸âʦ¸µ”RealDataÈ¥×öµ°¸â£¬realdataÏ൱ÓÚÆð¸öÏß³


Ïà¹ØÎĵµ£º

java Íâ¹Ò¡¡°´¼ü¾«Á飬¸ÐÐËȤ´ó¼ÒÒ»ÆðÀ´Ñ§Ï°¡£

 ÎÒÔÚÍæÒ»¸öÍøÒ³ÓÎÏ·µÄʱºò×ÜÊÇ°´Ò»¸ö¼ü¡£¾õ×ÅÀÛ¡£ËùÒÔ¾ÍдÁËÒ»¸ö³ÌÐò¡£
Robot r = new Robot();
// °´¼ü
r.keyPress(51);
// ÊÍ·Å
r.keyRelease(51);
ÓÃRobot Õâ¸öʵÏÖ×Ô¶¯»¯µÄÀà¾Í¿É×öµ½¡£ÊµÏÖÕâ¸öÓÎÏ·Ò»Ö±°´ÏÂÕâ¸ö¼ü×Ó¡£
Ò²¿ÉÒÔ×ö°´¼ü¾«ÁéÀàËƵÄÈí¼þ¡£µ«ÊÇÕâ¸öÀàÖ»ÄÜÓ¦Óõ±Ç°´°¿Ú¡£ÔõôÄÜ°ÑÕâ¸ö³ÌÐò¹Ì¶¨ÔÚij ......

Java source code for calculating E


The Mean Opinion
Score (MOS) test is a well acccepted standard which is defined in the ITU-T
Rec.P.800.
The value of MOS
test is generated by letting large number of listeners to evaluate the quality
of the test sentences. 
The test scores
are averaged to a mean score which range fro ......

ÔÚEclipseºÍNetBeansÖе¼ÈëJava API

 ¹¤ÓûÉÆÆäÊ£¬±ØÏÈÀûÆäÆ÷¡£ÊìϤ¿ª·¢»·¾³¿ÉÒÔÈÃÄã¸ü¿ì¸üºÃ¸üÊæ·þµØ¿ª·¢Èí¼þ¡£¾ÍÈçͬVC/.net¿ª·¢ÈËÔ±Àë²»¿ªmsdn£¬java¿ª·¢ÈËÔ±ÍùÍùÒ²Àë²»¿ªjava API¡£ÏÂÃæ½éÉÜÏÂÈçºÎÔÚEclipseºÍNetBeansÖе¼Èëjava API¡£Ê¹Ö®¿ÉÒÔ·½±ã¿ìËٵزéÕÒ£¬¶¨Î»¡£
¡¡¡¡±¾ÎÄÊʺÏÓë¸Õ¸Õ½Ó´¥Eclipse»òNetBeansµÄjava¿ª·¢ÈËÔ±£¬»òÕßÊÇÓо­ÑéµÄʹÓÃEc ......

java Ïß³Ìͬ²½

     Java ÊÇÒ»ÃÅÖ§³Ö¶àÏ̵߳ĵÄÓïÑÔ£¬µ«ÔÚ´¦Àí¶àÏß³ÌʼþʱÎÒÃDZØÐë×¢ÒâÕâÑùÒ»¸öÎÊÌ⣺¶à¸öÏ߳̿ÉÄÜͬʱ¶Ôͬһ¶ÔÏóµÄÐ޸ġ£Èç¹ûÎÒÃDz»¼°Ê±×÷³ö´¦Àí£¬¿ÉÄÜÒýÆð¶ÔÏóÖµµÄ»ìÂÒ¡£Æäʵ´¦Àí°ì·¨Ò²ºÜ¼òµ¥£¬¾ÍÊǵ±Ò»¸öÏ̴߳¦ÀíÒ»¸ö¶ÔÏó£¬Ëøס¸Ã¶ÔÏó¡£ ......

ÉîÈë̽Ë÷Java¹¤×÷Ô­Àí£ºJVM£¬ÄÚ´æ»ØÊÕ¼°ÆäËû

JavaÓïÑÔÒýÈëÁËJavaÐéÄâ»ú£¬¾ßÓпçƽ̨ÔËÐеŦÄÜ£¬Äܹ»ºÜºÃµØÊÊÓ¦¸÷ÖÖWebÓ¦Óá£Í¬Ê±£¬ÎªÁËÌá¸ßJavaÓïÑÔµÄÐÔÄܺͽ¡×³ÐÔ£¬»¹ÒýÈëÁËÈçÀ¬»ø»ØÊÕ»úÖƵÈй¦ÄÜ£¬Í¨¹ýÕâЩ¸Ä½øÈÃJava¾ßÓÐÆä¶ÀÌصŤ×÷Ô­Àí¡£
1£®JavaÐéÄâ»ú
JavaÐéÄâ»ú£¨Java Virtual Machine£¬JVM£©ÊÇÈí¼þÄ£ÄâµÄ¼ÆËã»ú£¬Ëü¿ÉÒÔÔÚÈκδ¦ÀíÆ÷ÉÏ£¨ÎÞÂÛÊÇÔÚ¼ÆËã»úÖл ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ