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

JavaỊ̈߳ºÐÂÌØÕ÷ Ëø£¨ÉÏ£©

JavaỊ̈߳ºÐÂÌØÕ÷-Ëø£¨ÉÏ£©
 
ÔÚJava5ÖУ¬×¨ÃÅÌṩÁËËø¶ÔÏó£¬ÀûÓÃËø¿ÉÒÔ·½±ãµÄʵÏÖ×ÊÔ´µÄ·âËø£¬ÓÃÀ´¿ØÖƶԾºÕù×ÊÔ´²¢·¢·ÃÎʵĿØÖÆ£¬ÕâЩÄÚÈÝÖ÷Òª¼¯ÖÐÔÚjava.util.concurrent.locks °üÏÂÃæ£¬ÀïÃæÓÐÈý¸öÖØÒªµÄ½Ó¿ÚCondition¡¢Lock¡¢ReadWriteLock¡£
 
Condition
Condition ½« Object ¼àÊÓÆ÷·½·¨£¨wait¡¢notify ºÍ notifyAll£©·Ö½â³É½ØÈ»²»Í¬µÄ¶ÔÏó£¬ÒÔ±ãͨ¹ý½«ÕâЩ¶ÔÏóÓëÈÎÒâ Lock ʵÏÖ×éºÏʹÓã¬ÎªÃ¿¸ö¶ÔÏóÌṩ¶à¸öµÈ´ý set £¨wait-set£©¡£
Lock
Lock ʵÏÖÌṩÁ˱ÈʹÓà synchronized ·½·¨ºÍÓï¾ä¿É»ñµÃµÄ¸ü¹ã·ºµÄËø¶¨²Ù×÷¡£
ReadWriteLock
ReadWriteLock ά»¤ÁËÒ»¶ÔÏà¹ØµÄËø¶¨£¬Ò»¸öÓÃÓÚÖ»¶Á²Ù×÷£¬ÁíÒ»¸öÓÃÓÚдÈë²Ù×÷¡£
 
ÓйØËøµÄ½éÉÜ,APIÎĵµ½â˵ºÜ¶à£¬¿´µÃºÜ·³£¬»¹ÊÇ¿´¸öÀý×ÓÔÙ¿´Îĵµ±È½ÏÈÝÒ×Àí½â¡£
 
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* JavaỊ̈߳ºËø
*
* @author leizhimin 2009-11-5 10:57:29
*/
public class Test {
        public static void main(String[] args) {
                //´´½¨²¢·¢·ÃÎʵÄÕË»§
                MyCount myCount = new MyCount("95599200901215522", 10000);
                //´´½¨Ò»¸öËø¶ÔÏó
                Lock lock = new ReentrantLock();
                //´´½¨Ò»¸öÏ̳߳Ø
                ExecutorService pool = Executors.newCachedThreadPool();
                //´´½¨Ò»Ð©²¢·¢·ÃÎÊÓû§£¬Ò»¸öÐÅÓÿ¨£¬´æµÄ´æ£¬È¡µÄÈ¡£¬ºÃÈÈÄÖ°¡


Ïà¹ØÎĵµ£º

javaÖÐ== ÓëequalsµÄÇø±ð

public class test1
{
 public static void main(String[] args){
  //== ÓëequalsµÄÇø±ð
  //1.nullµÄ±È½Ï£ºÖ»ÄÜÓÃ==
  System.out.println("1.nullµÄ±È½Ï£ºÖ»ÄÜÓÃ==");
  Object o1=null,o2=null;
  System.out.println(null==null&&o1==null& ......

JavaỊ̈߳ºÏ̵߳ĵ÷¶È ÓÅÏȼ¶

JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÓÅÏȼ¶
 
ÓëÏß³ÌÐÝÃßÀàËÆ£¬Ï̵߳ÄÓÅÏȼ¶ÈÔÈ»ÎÞ·¨±£ÕÏÏ̵߳ÄÖ´ÐдÎÐò¡£Ö»²»¹ý£¬ÓÅÏȼ¶¸ßµÄÏ̻߳ñÈ¡CPU×ÊÔ´µÄ¸ÅÂʽϴó£¬ÓÅÏȼ¶µÍµÄ²¢·Çû»ú»áÖ´ÐС£
 
Ï̵߳ÄÓÅÏȼ¶ÓÃ1-10Ö®¼äµÄÕûÊý±íʾ£¬ÊýÖµÔ½´óÓÅÏȼ¶Ô½¸ß£¬Ä¬ÈϵÄÓÅÏȼ¶Îª5¡£
 
ÔÚÒ»¸öÏß³ÌÖпªÆôÁíÍâÒ»¸öÐÂỊ̈߳¬ÔòпªÏ̳߳ÆÎ ......

JavaỊ̈߳ºÐÂÌØÕ÷ Ï̳߳Ø

JavaỊ̈߳ºÐÂÌØÕ÷-Ï̳߳Ø
 
SunÔÚJava5ÖУ¬¶ÔJavaÏ̵߳ÄÀà¿â×öÁË´óÁ¿µÄÀ©Õ¹£¬ÆäÖÐÏ̳߳ؾÍÊÇJava5µÄÐÂÌØÕ÷Ö®Ò»£¬³ýÁËÏ̳߳ØÖ®Í⣬»¹Óкܶà¶àÏß³ÌÏà¹ØµÄÄÚÈÝ£¬Îª¶àÏ̵߳ıà³Ì´øÀ´Á˼«´ó±ãÀû¡£ÎªÁ˱àд¸ßЧÎȶ¨¿É¿¿µÄ¶àÏ̳߳ÌÐò£¬Ï̲߳¿·ÖµÄÐÂÔöÄÚÈÝÏÔµÃÓÈÎªÖØÒª¡£
 
ÓйØJava5Ïß³ÌÐÂÌØÕ÷µÄÄÚÈÝÈ«²¿ÔÚjava.util ......

Eclipse Java×¢ÊÍÄ£°åÉèÖÃÏê½â


ÉèÖÃ×¢ÊÍÄ£°åµÄÈë¿Ú£º Window->Preference->Java->Code Style->Code Template È»ºóÕ¹¿ªComments½Úµã¾ÍÊÇËùÓÐÐèÉèÖÃ×¢Ê͵ÄÔªËØÀ²¡£ÏÖ¾Íÿһ¸öÔªËØÖðÒ»½éÉÜ£º
Îļþ(Files)×¢ÊͱêÇ©£º
/**   
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(ÓÃÒ»¾ä»°ÃèÊö¸ÃÎļ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ