ʵսJava¶àÏ̱߳à³Ì²»Ìᳫ×ö·¨
²»ÌᳫʹÓõķ½·¨ÊÇΪ֧³ÖÏòºó¼æÈÝÐÔ¶ø±£ÁôµÄÄÇЩ·½·¨£¬ËüÃÇÔÚÒÔºóµÄ°æ±¾ÖпÉÄܳöÏÖ£¬Ò²¿ÉÄܲ»³öÏÖ¡£Java ¶àÏß³ÌÖ§³ÖÔÚ°æ±¾ 1.1 ºÍ°æ±¾ 1.2 ÖÐ×öÁËÖØ´óÐÞ¶©£¬stop()¡¢suspend() ºÍ resume() º¯ÊýÒѲ»ÌᳫʹÓá£ÕâЩº¯ÊýÔÚ JVM ÖпÉÄÜÒýÈë΢ÃîµÄ´íÎó¡£ËäÈ»º¯ÊýÃû¿ÉÄÜÌýÆðÀ´ºÜÓÕÈË£¬µ«ÇëµÖÖÆÓÕ»ó²»ÒªÊ¹ÓÃËüÃÇ¡£
µ÷ÊÔÏ̻߳¯µÄ³ÌÐò
ÔÚJavaÏ̻߳¯µÄ³ÌÐòÖУ¬¿ÉÄÜ·¢ÉúµÄijЩ³£¼û¶øÌÖÑáµÄÇé¿öÊÇËÀËø¡¢»îËø¡¢ÄÚ´æË𻵺Í×ÊÔ´ºÄ¾¡¡£
ËÀËø
ËÀËø¿ÉÄÜÊÇJava¶àÏ̳߳ÌÐò×î³£¼ûµÄÎÊÌâ¡£µ±Ò»¸öÏß³ÌÐèÒªÒ»¸ö×ÊÔ´¶øÁíÒ»¸öÏ̳߳ÖÓиÃ×ÊÔ´µÄËøʱ£¬¾Í»á·¢ÉúËÀËø¡£ÕâÖÖÇé¿öͨ³£ºÜÄѼì²â¡£µ«ÊÇ£¬½â¾ö·½°¸È´Ï൱ºÃ£ºÔÚËùÓеÄÏß³ÌÖа´ÏàͬµÄ´ÎÐò»ñÈ¡ËùÓÐ×ÊÔ´Ëø¡£ÀýÈ磬Èç¹ûÓÐËĸö×ÊÔ´ —A¡¢B¡¢C ºÍ D — ²¢ÇÒÒ»¸öÏ߳̿ÉÄÜÒª»ñÈ¡Ëĸö×ÊÔ´ÖÐÈκÎÒ»¸ö×ÊÔ´µÄËø£¬ÔòÇëÈ·±£ÔÚ»ñÈ¡¶Ô B µÄËø֮ǰÊ×ÏÈ»ñÈ¡¶Ô A µÄËø£¬ÒÀ´ËÀàÍÆ¡£Èç¹û“Ïß³Ì 1”Ï£Íû»ñÈ¡¶Ô B ºÍ C µÄËø£¬¶ø“Ïß³Ì 2”»ñÈ¡ÁË A¡¢C ºÍ D µÄËø£¬ÔòÕâÒ»¼¼Êõ¿ÉÄܵ¼ÖÂ×èÈû£¬µ«ËüÓÀÔ¶²»»áÔÚÕâËĸöËøÉÏÔì³ÉËÀËø¡£
»îËø
µ±Ò»¸öÏß³ÌæÓÚ½ÓÊÜÐÂÈÎÎñÒÔÖÂËüÓÀԶûÓлú»áÍê³ÉÈκÎÈÎÎñʱ£¬¾Í»á·¢Éú»îËø¡£Õâ¸öÏß³Ì×îÖÕ½«³¬³ö»º³åÇø²¢µ¼Ö³ÌÐò±ÀÀ£¡£ÊÔÏëÒ»¸öÃØÊéÐèҪ¼ÈëÒ»·âÐÅ£¬µ«ËýÒ»Ö±ÔÚæÓڽӵ绰£¬ËùÒÔÕâ·âÐÅÓÀÔ¶²»»á±»Â¼Èë¡£
ÄÚ´æËð»µ
Èç¹ûÃ÷ÖǵØʹÓà synchronized ¹Ø¼ü×Ö£¬ÔòÍêÈ«¿ÉÒÔ±ÜÃâÄÚ´æ´íÎóÕâÖÖÆøËÀÈ˵ÄÎÊÌâ¡£
×ÊÔ´ºÄ¾¡
ijЩϵͳ×ÊÔ´ÊÇÓÐÏ޵ģ¬ÈçÎļþÃèÊö·û¡£¶àÏ̳߳ÌÐò¿ÉÄܺľ¡×ÊÔ´£¬ÒòΪÿ¸öÏ̶߳¼¿ÉÄÜÏ£ÍûÓÐÒ»¸öÕâÑùµÄ×ÊÔ´¡£Èç¹ûÏß³ÌÊýÏ൱´ó£¬»òÕßij¸ö×ÊÔ´µÄºîÑ¡Ïß³ÌÊýÔ¶Ô¶³¬¹ýÁË¿ÉÓõÄ×ÊÔ´Êý£¬Ôò×îºÃʹÓÃ×ÊÔ´³Ø¡£Ò»¸ö×îºÃµÄʾÀýÊÇÊý¾Ý¿âÁ¬½Ó³Ø¡£Ö»ÒªÏß³ÌÐèҪʹÓÃÒ»¸öÊý¾Ý¿âÁ¬½Ó£¬Ëü¾Í´Ó³ØÖÐÈ¡³öÒ»¸ö£¬Ê¹ÓÃÒÔºóÔÙ½«Ëü·µ»Ø³ØÖС£×ÊÔ´³ØÒ²³ÆΪ ×ÊÔ´¿â¡£
µ÷ÊÔ´óÁ¿µÄÏß³Ì
ÔÚJava¶àÏ̳߳ÌÐòÖУ¬ÓÐʱһ¸ö³ÌÐòÒòΪÓдóÁ¿µÄÏß³ÌÔÚÔËÐжø¼«Äѵ÷ÊÔ¡£ÔÚÕâÖÖÇé¿öÏ£¬ÏÂÃæµÄÕâ¸öÀà¿ÉÄÜ»áÅÉÉÏÓ󡣺
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
public class Probe extends Thread {
public Probe() {}
public void run() {
while(true) {
Thread[] x = new Thread[100];
Thread.enumerate(x);
for(int i=0; i<100; i++) {
¡¡Thread t = x;
¡¡if(t == null)
break;
¡¡else
System.out.println(t.getName() + "\t" + t.getPriority()
+ "\t" + t.isAlive() + "\t" + t.isDaemon());
}
}
Ïà¹ØÎĵµ£º
ÈçºÎÈ¡µÄJavaÔ´´úÂëÎļþÖÐÎļþÃûºÍÐкţº£©
ÔÚC/C++µÄ³ÌÐò£¬±àÒëÆ÷ÌṩÁËÁ½¸öºêÀ´Ö§³ÖÈ¡µÃÔ´ÎļþÖеÄÐкźÍÎļþÃû£¬ÕâÁ½¸öºêÊÇ__FILE__,__LINE__
Äã¿ÉÒÔÈçϵķ½·¨´òÓ¡ÐкźÍÎļþÃû
²é¿´Ô´´úÂë
´òÓ¡°ïÖú
1 #include <stdio.h>
2 int main()
3 {
4&nbs ......
ÔÚ±àÒëandroid code ³öÏÖ°æ±¾²»¶ÔµÄÎÊÌ⣺
ÃèÊöÈçÏ£º
You are attempting to build with the incorrect version
of java.
Your version is: java version "1.6.0_17".
The correct version is: 1.5.
Please follow the machine setup instructions at
http://source.android.com/download
ÍøÉÏÓÐÈËÌṩ½â¾ö·½·¨ÈçÏ ......
ÔÚÕâÀï½éÉÜÁ½ÖÖ·½·¨Éú³Éjar£¬µÚÒ»ÖÖÊÇÓÃEclpiseµÄExport¹¦ÄÜ¡£ÔÚÒª´ò°üµÄÏîÄ¿ÉÏ»÷ÓÒ¼ü£¬Ñ¡ÔñExport£¬ÔÚ´°¿ÚÖÐÑ¡ÔñJavaÀïµÄJAR file¡£NextºóµÄ´°¿ÚÖÐÒѾ×Ô¶¯Ñ¡ºÃÁËÒª´ò°üµÄÏîÄ¿£¬Óû§¿ÉÒÔµã»÷¼ÓºÅ²é¿´ÏîÄ¿Àï±»´ò°üµÄÄÚÈÝ¡£ÔÚÏÂÃæµÄJAR fileÀïÉèÖÃÄã´ò°üÉú³ÉjarÎļþµÄÊä³öĿ¼£¬ÏÂÒ»²½ÔÚ³öÏֵĴ°¿ÚÖÐÑ¡ÔñUse existin ......
ʹÓÃJava·¢ËÍGET¡¢POSTÇëÇó
——½ÚÑ¡×Ô¡¶·è¿ñJava½²Òå¡·
URLµÄopenConnection()·½·¨½«·µ»ØÒ»¸öURLConnection¶ÔÏ󣬸öÔÏó±íʾӦÓóÌÐòºÍ URL Ö®¼äµÄͨÐÅÁ´½Ó¡£³ÌÐò¿ÉÒÔͨ¹ýURLConnectionʵÀýÏò¸ÃURL·¢ËÍÇëÇ󡢶ÁÈ¡URLÒýÓõÄ×ÊÔ´¡£
ͨ³£´´½¨Ò»¸öºÍ URL µÄÁ¬½Ó£¬²¢·¢ËÍÇëÇ󡢶ÁÈ¡´Ë URL ÒýÓõÄ×ÊÔ´ÐèÒªÈçÏ ......
Ò» Ï̵߳Ļù±¾¸ÅÄî
Ïß³ÌÊÇÒ»¸ö³ÌÐòÄÚ²¿µÄ˳Ðò¿ØÖÆÁ÷.Ò»¸ö½ø³ÌÏ൱ÓÚÒ»¸öÈÎÎñ,Ò»¸öÏß³ÌÏ൱ÓÚÒ»¸öÈÎÎñÖеÄÒ»ÌõÖ´Ðз¾¶.£»¶à½ø³Ì:ÔÚ²Ù×÷ϵͳÖÐÄÜͬʱÔËÐжà¸öÈÎÎñ (³ÌÐò)£»¶àÏß³Ì:ÔÚͬһ¸öÓ¦ÓóÌÐòÖÐÓжà¸ö˳ÐòÁ÷ͬʱִÐУ»JavaµÄÏß³ÌÊÇͨ¹ýjava.lang.ThreadÀàÀ´ÊµÏֵģ»JVMÆô¶¯Ê±»áÓÐÒ»¸öÓÉÖ÷·½·¨(public static voi ......