dz̸Java¶àÏ̵߳Äͬ²½ÎÊÌâ
¶àÏ̵߳Äͬ²½ÒÀ¿¿µÄÊǶÔÏóËø»úÖÆ£¬synchronized¹Ø¼ü×ֵı³ºó¾ÍÊÇÀûÓÃÁË·âËøÀ´ÊµÏÖ¶Ô¹²Ïí×ÊÔ´µÄ»¥³â·ÃÎÊ¡£
ÏÂÃæÒÔÒ»¸ö¼òµ¥µÄʵÀýÀ´½øÐжԱȷÖÎö¡£ÊµÀýÒªÍê³ÉµÄ¹¤×÷·Ç³£¼òµ¥£¬¾ÍÊÇ´´½¨10¸öỊ̈߳¬Ã¿¸öÏ̶߳¼´òÓ¡´Ó0µ½99Õâ100¸öÊý×Ö£¬ÎÒÃÇÏ£ÍûÏß³ÌÖ®¼ä²»»á³öÏÖ½»²æÂÒÐò´òÓ¡£¬¶øÊÇ˳ÐòµØ´òÓ¡¡£
ÏÈÀ´¿´µÚÒ»¶Î´úÂ룬ÕâÀïÎÒÃÇÔÚrun()·½·¨ÖмÓÈëÁËsynchronized¹Ø¼ü×Ö£¬Ï£ÍûÄܶÔrun·½·¨½øÐл¥³â·ÃÎÊ£¬µ«½á¹û²¢²»ÈçÎÒÃÇÏ£ÍûÄÇÑù£¬ÕâÊÇÒòΪÕâÀïsynchronizedËøסµÄÊÇthis¶ÔÏ󣬼´µ±Ç°ÔËÐÐÏ̶߳ÔÏó±¾Éí¡£´úÂëÖд´½¨ÁË10¸öỊ̈߳¬¶øÿ¸öÏ̶߳¼³ÖÓÐthis¶ÔÏóµÄ¶ÔÏóËø£¬Õâ²»ÄÜʵÏÖÏ̵߳Äͬ²½¡£´úÂëpackage com.vista;
class MyThread implements java.lang.Runnable
{
private int threadId;
public MyThread(int id)
{
this.threadId = id;
}
@Override
public synchronized void run()
{
for (int i = 0; i < 100; ++i)
{
System.out.println("Thread ID: " + this.threadId + " : " + i);
}
}
}
public class ThreadDemo
{
/**
* @param args
* @throws InterruptedException
*/
public static void main(String[] args) throws InterruptedException
{
for (int i = 0; i < 10; ++i)
&nbs
Ïà¹ØÎĵµ£º
1. ÓÃScriptEngineManagerÀà¡£ÕâÊÇ»ùÓÚJSR-223¹æ·¶µÄjava½Å±¾API( scripting API)¡£¿ÉÒÔÔÚjava³ÌÐòÖÐÔËÐÐһЩ½Å±¾£¬Èç JavaFX script, javascriptµÈ¡£
¡¡¡¡2. ͨ¹ýJavaFX reflection API¡£ÕâÊÇJavaFXÌṩµÄ·´ÉäAPI£¬¼¸ºõ¿ÉÒÔµ÷ÓÃËùÓеÄJavaFXÀà¡£
¡¡¡¡3. ÏÈÓÃJavaFXÀàʵÏÖÒ»¸öJavaµÄinterface£¬È»ºóJava³ÌÐò¿ÉÒÔͨ¹ýÕ⸠......
½ñÄêÒѾ28ËêÁË Í»È»·¢ÏÖÒѾºÜ²»Ï°¹ß±àд´úÂëÁË£¬µ«ÊǶԳÌÐòÖÐËùÓеĴíÎóºÍÀ§ÄÑ£¬¶¼ÄܺÜƽ¾²µÄÈ¥½â¾ö£¬µ±Ò»¸öеÄÏîÄ¿À´µÄʱºò£¬×ÜÊÇϲ»¶È¥Éè¼ÆËü·ÖÎöËü£¬¿ÉºÜÄÑϵÚÒ»±ÊÈ¥±àдËü£¬²»ÖªµÀÊDz»ÊÇÀÏÁË£¬ÏëÁ˼¸ÌìÁËÕæ²»ÖªµÀÊDz»Êǵ½ÁËתÐÍʱÆÚÁË¡£ ......
Java 7ÒѾÍê³ÉµÄÆß´óй¦ÄÜÔ¤ÀÀzz
2009-12-12 09:15
×î½üµÄDevoxx´ó»áÉÏ£¬Java 7½«°üº¬±Õ°üµÄÏûÏ¢ÁîºÜ¶àÈ˸е½Õñ·Ü——Õ⽫×öΪһ¸ö¶ÀÁ¢µÄJSR±»ÊµÏÖ¡£ÔÚÖÚ¶àJava 7еÄÓïÑÔÌØÐÔÖУ¬ÓÐһЩÏÖÔÚÒѾÍê³ÉÁË¡£Devoxx´ó»áµÄһλ²Î»áÕßÔÚ²©¿ÍÖб¨¸æÁËÏÂÃæÕâЩJava 7ÒѾÍê³ÉµÄ7´óй¦ÄÜ£º
1£©¶Ô¼¯ºÏÀàµÄÓïÑÔÖ§³Ö£»
......
JavaʼþÄ£ÐÍÓëAndroidʼþÄ£Ð͵ıȽÏ
±È½Ï½á¹û£ºAndroid½è¼øÁËJava2ÖеÄUIʼþ´¦Àí»úÖÆ£¬µ«ÊÇ£¬AndroidÓÖÌṩÁËÁíÒ»ÖÖʼþ處ÀíÆ÷£¨event handler£©£¬¶øÕâ¸ö·½Ê½ÊÇ·ñÓëjava1.0ʼþÄ£ÐÍÒ»ÑùÄØ£¬ÓдýÇóÖ¤¡£
JavaʼþÄ£ÐÍ£º
ÎÒÃÇ°ÑJDK1.0ʼþ´¦ÀíÄ£ÐͳÉΪJava1.0ʼþÄ£ÐÍ£¬¶ø´Ójdk1.1ºóµÄ°æ±¾Ê¼þ´¦ÀíÄ£ÐͳÆΪJava 2Ê ......
ºÜ¶àÍøÓÑ×ÉѯѧϰJavaÓÐûÓÐʲô½Ý¾¶,ÎÒ˵“ÎÞËû£¬Î¨ÊÖÊì¶û”¡£µ«ÊÇÉÐѧÌÃÔ¸Ò⽫һЩ¾Ñéд³öÀ´£¬ÒÔ±ãºóÀ´ÕßÉÙ×ßÍä·,°ïÖú±ðÈËÊÇ×î´óµÄ¿ìÀÖÂ
ÒªÏëѧºÃJava£¬Ê×ÏÈÒªÖªµÀJavaµÄ´óÖ·ÖÀà¡£ÎÒÃÇÖªµÀ£¬×Ô´ÓSunÍƳöJavaÒÔÀ´£¬¾ÍÁ¦Í¼Ê¹Ö®ÎÞËù²»°ü£¬ËùÒÔJava·¢Õ¹µ½ÏÖÔÚ£¬°´Ó¦ÓÃÀ´·ÖÖ÷Òª·ÖΪÈý´ó¿é£ºJ2SE,J2MEºÍJ2EE, ......