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

javaдµÄÒ»¸öËÀËøÀý×Ó

public class DeadLock {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
final Object resource1 = "resource1";
final Object resource2 = "resource2";

Thread t1 = new Thread(){
public void run(){
synchronized(resource1){
System.out.println("Thread1:locked resource1");
try{
Thread.sleep(50);
}catch(Exception ex){

}
synchronized(resource2){
System.out.println("Thread1:locked resource2");
}
}
}
};

Thread t2 = new Thread(){
public void run(){
synchronized(resource2){
System.out.println("Thread2:locked resource2");
try{
Thread.sleep(50);
}catch(Exception ex){

}
synchronized(resource1){
System.out.println("Thread2:locked resource1");
}
}
}
};

t1.start();
t2.start();
}
}


Ïà¹ØÎĵµ£º

Java ÖжÓÁеÄʹÓÃ

¸Õ²Å¿´¼ûȺÀïµÄÒ»¸öÅóÓÑÔÚÎʶÓÁеÄʹÓã¬È·ÊµÔÚÏÖʵµÄд´úÂëÖкÜÉÙʹÓöÓÁеģ¬·´ÕýÎÒÊÇ´ÓÀ´Ã»Ê¹Óùý¡£Ö»ÊÇѧÊý¾Ý½á¹¹µÄʱºòѧ¹ý¡£
ÏÂÃæÊÇÎÒдµÄÒ»¸öСÀý×Ó£¬Ï£ÍûÓв»×ãÖ®´¦ÇëÌá³ö¸ÄÕý¡£O(∩_∩)O~
¿´´úÂ룺
import java.util.LinkedList;
import java.util.Queue;
public class TestQueue
{
/**
* @param ......

javaö¾Ù

javaö¾Ù
ΪʲôҪ¶¨Òåö¾Ù£¿
ÎÊÌ⣺Ҫ¶¨ÒåÐÇÆÚ¼¸»òÐÔ±ðµÄ±äÁ¿£¬¸ÃÔõô¶¨Ò壿¼ÙÉèÓÃ1-7·Ö±ð±íʾÐÇÆÚÒ»µ½ÐÇÆÚÈÕ£¬µ«ÓÐÈË¿ÉÄÜ»áд³Éint weekday = 0;
ö¾Ù¾ÍÊÇÒªÈÃij¸öÀàÐ͵ıäÁ¿µÄÈ¡ÖµÖ»ÄÜΪÈô¸É¸ö¹Ì¶¨ÖµÖеÄÒ»¸ö£¬·ñÔò£¬±àÒëÆ÷¾Í»á±¨´í£¬Ã¶¾Ù¿ÉÒÔÈñàÒëÆ÷ÔÚ±àÒëʱ¾Í¿ÉÒÔ¿ØÖƳÌÐòÖÐÌîдµÄ·Ç·¨Öµ£¬ÆÕͨ±äÁ¿µÄ·½Ê½ÔÚ¿ª·¢½×¶ ......

java Ïà¶Ô·¾¶ ¾ø¶Ô·¾¶ classes bin ¸ùĿ¼

³¢ÊÔÓÃDOM4j½âÎöspringÅäÖÃÎļþʱ,µÚÒ»²½¶ÁÈ¡Îļþʱ£¬»ñȡ·¾¶¾ÍÓöµ½ÁËÎÊÌ⣬¡£¡£¡£¾­¹ýgoogleÁËn+log n ´Î¸öÒ³Ã棬²ÅËãÓÐÁ˸ö´ÖdzµÄÈÏʶ£¬ÏÂÃæ¾ÍÈÃÎÒÓüò¶ÌµÄ»°ÓïÀ´×ܽáһϣ¨ºÃÏñÕâ¶Î¾ÍÈ«ÊÇ·Ï»°¡£¡£¡££©¡£¡£¡£
1¡¢springµÄÅäÖÃÎļþ´æ·ÅλÖÃÓÉweb.xmlÀïµÄcontextConfigLocationÀ´È·¶¨£¬Ò»°ãÊÇ·ÅÔÚweb-inf»òÕßÊÇsrc¸ùÄ¿Â¼Ï ......

Java °´×Ö½Ú½ØÈ¡´øÓкº×ÖµÄ×Ö·û´®µÄÒ»ÖÖ×ö·¨

Java °´×Ö½Ú½ØÈ¡´øÓкº×ÖµÄ×Ö·û´®µÄ½â·¨£¬ÍøÉÏÓв»ÉÙÌÖÂÛ¡£ÕâÀïÎÒÒ²¸ø³öÒ»ÖÖÎÒ×Ô¼ºµÄ´¦Àí£¬»ù±¾Ô­Àí»¹ÊÇͳ¼ÆÒª½ØÈ¡µÄ×Ö½ÚÊýÖÐÊDZíʾºº×ÖµÄ×Ö½ÚÊýÊÇ·ñÊÇżÊý¸ö£¬¼´ÊÇ·ñ¸ÕºÃ°üÀ¨ÁËÍêÕûµÄºº×Ö¡£
/**
 * ±à³Ì£º±àдһ¸ö½ØÈ¡×Ö·û´®µÄº¯Êý£¬ÊäÈëΪһ¸ö×Ö·û´®ºÍ×Ö½ÚÊý£¬Êä³öΪ°´×Ö½Ú½ØÈ¡µÄ×Ö·û´®¡£ µ«ÊÇÒª±£Ö¤ºº×Ö²»±»½Ø°ë¸ ......

Eclipseµ÷ÊÔJava´úÂë

Debug͸ÊÓͼ
http://www.cnblogs.com/Jamesliang/archive/2010/01/09/1643188.html
      µ±µã»÷Debug°´Å¥Ê±£¬Eclipse»áÌáʾÄã½øÈë Debug͸ÊÓͼ¡£¿ÉÒÔÔÚÓÒÉÏ·½Expressions´°¿Úµã»÷Êó±êÓÒ¼üÔÚµ¯³ö²Ëµ¥ÖÐÑ¡Ôñ Add Watch Expression »òÕßµã»÷ÈçÏÂͼËùʾ°´Å¥Ôò»á³öÏÖ£¬Ìí¼Ó±í´ïʽ´°¿Ú¡£Äã¿ÉÒÔÊäÈëÄã ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ