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Ï൱ÓÚÆð¸öÏß³
Ïà¹ØÎĵµ£º
Hibernate¡¢TopLinkµÈOR Mapping²Ù×÷Êý¾Ý¿âµÄ¼¼Êõ¶¼Êǽ¨Á¢JDBC¼¼ÊõÖ®Éϵģ¬Êµ¼ÊÀ´Ëµ£¬ËûÃǵÄÐÔÄܺÍJDBCÊÇÓкܴó²î¾àµÄ£¬µ«·´¹ýÀ´Ëµ£¬Èç¹ûJDBCÓò»ºÃ£¬»¹²»Èç hibernateÄØ¡£ÔÝÇÒ²»ËµÕâЩÊëÓÅÊëÁӵĻ°ÁË£¬ÔÙ´ÎÖ÷ÒªÊǶÔJavaµÄ»ù´¡¼¼Êõ×ö¸ö×ܽᣬÒÔ¼ÓÉîÈÏʶ¡£
Ò»¡¢JDBCµÄ»ù±¾ÔÀí
JDBCÊÇJava²Ù×÷Êý¾Ý¿âµÄ¼¼Êõ¹æ·¶¡£Ëûʵ ......
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 ......
1. Java Ô´ÎļþÖÐ×î¶àÖ»ÄÜÓÐÒ»¸öpublicÀà,¶øÇÒÕâ¸öÀàµÄÀàÃûÒªºÍÎļþÃûÒ»ÖÂ.ÆäËûÀàµÄ¸öÊý²»ÏÞ¡£
2. ÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄÌØÕ÷£¨·â×°ÐÔ£©£¨¼Ì³Ð£©£¨¶à̬ÐÔ£©
3. ½Ó¿ÚÊÇÓÉ£¨³éÏó·½·¨£©ºÍ£¨³£Á¿£©×é³ÉµÄÌØÊâÀà
4. ÓÃstaticÐÞÊεķ½·¨Ê ......
Java ÊÇÒ»ÃÅÖ§³Ö¶àÏ̵߳ĵÄÓïÑÔ£¬µ«ÔÚ´¦Àí¶àÏß³ÌʼþʱÎÒÃDZØÐë×¢ÒâÕâÑùÒ»¸öÎÊÌ⣺¶à¸öÏ߳̿ÉÄÜͬʱ¶Ôͬһ¶ÔÏóµÄÐ޸ġ£Èç¹ûÎÒÃDz»¼°Ê±×÷³ö´¦Àí£¬¿ÉÄÜÒýÆð¶ÔÏóÖµµÄ»ìÂÒ¡£Æäʵ´¦Àí°ì·¨Ò²ºÜ¼òµ¥£¬¾ÍÊǵ±Ò»¸öÏ̴߳¦ÀíÒ»¸ö¶ÔÏó£¬Ëøס¸Ã¶ÔÏó¡£ ......
JAVA³£ÓÃÀàµÄʹÓ÷½·¨
£±¡¢IntegerÀà
£²¡¢FloatÀà
£³¡¢DoubleÀà
£´¡¢CharacterÀà
£µ¡¢StringÀà
£¶¡¢StringTokenizerÀà
£·¡¢StringBufferÀà
£¸¡¢RandomÀà
1£®IntegerÀàµÄʹÓ÷½·¨
Interger£ºÕûÊýÀàÐÍ
£±¡¢ÊôÐÔ¡£
static int MAX_VALUE£º·µ»Ø×î´óµÄÕûÐÍÊý£»
static int MIN_VALUE£º·µ»Ø×îСµÄÕûÐÍÊý£»
static C ......