JavaỊ̈߳ºÏ̵߳ĵ÷¶È ÓÅÏȼ¶
JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÓÅÏȼ¶
ÓëÏß³ÌÐÝÃßÀàËÆ£¬Ï̵߳ÄÓÅÏȼ¶ÈÔÈ»ÎÞ·¨±£ÕÏÏ̵߳ÄÖ´ÐдÎÐò¡£Ö»²»¹ý£¬ÓÅÏȼ¶¸ßµÄÏ̻߳ñÈ¡CPU×ÊÔ´µÄ¸ÅÂʽϴó£¬ÓÅÏȼ¶µÍµÄ²¢·Çû»ú»áÖ´ÐС£
Ï̵߳ÄÓÅÏȼ¶ÓÃ1-10Ö®¼äµÄÕûÊý±íʾ£¬ÊýÖµÔ½´óÓÅÏȼ¶Ô½¸ß£¬Ä¬ÈϵÄÓÅÏȼ¶Îª5¡£
ÔÚÒ»¸öÏß³ÌÖпªÆôÁíÍâÒ»¸öÐÂỊ̈߳¬ÔòпªÏ̳߳ÆΪ¸ÃÏ̵߳Ä×ÓỊ̈߳¬×ÓÏ̳߳õʼÓÅÏȼ¶Ó븸Ïß³ÌÏàͬ¡£
/**
* JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÓÅÏȼ¶
*
* @author leizhimin 2009-11-4 9:02:40
*/
public class Test {
public static void main(String[] args) {
Thread t1 = new MyThread1();
Thread t2 = new Thread(new MyRunnable());
t1.setPriority(10);
t2.setPriority(1);
t2.start();
t1.start();
}
}
class MyThread1 extends Thread {
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println("Ïß³Ì1µÚ" + i + "´ÎÖ´ÐУ¡");
try {
&nbs
Ïà¹ØÎĵµ£º
Éè¼Æģʽ
Ò»¸ö³ÌÐòÔ±¶ÔÉè¼ÆģʽµÄÀí½â:
“²»¶®”ΪʲôҪ°ÑºÜ¼òµ¥µÄ¶«Î÷¸ãµÃÄÇô¸´ÔÓ¡£ºóÀ´Ëæ×ÅÈí¼þ¿ª·¢¾ÑéµÄÔö¼Ó²Å¿ªÊ¼Ã÷°×ÎÒËù¿´µ½µÄ“¸´ÔӔǡǡ¾ÍÊÇÉè¼ÆģʽµÄ¾«ËèËùÔÚ£¬ÎÒËùÀí½âµÄ“¼òµ¥”¾ÍÊÇÒ»°ÑÔ¿³×¿ªÒ»°ÑËøµÄģʽ£¬Ä¿µÄ½ö½öÊÇ×ÅÑÛÓÚ½â¾öÏÖÔÚµÄÎÊÌ⣬¶øÉè¼ÆģʽµÄ“¸´ÔÓ&rdq ......
×÷ΪJava³ÌÐòÔ±À´Ëµ£¬×îÍ´¿àµÄÊÂÇéĪ¹ýÓÚ¿ÉÒÔÑ¡ÔñµÄ·¶Î§Ì«¹ã£¬¿ÉÒÔ¶ÁµÄÊéÌ«¶à£¬ÍùÍùÈÝÒ×ÎÞËùÊÊ´Ó¡£ÎÒÏë¾ÍÎÒ×Ô¼º¶Á¹ýµÄ¼¼ÊõÊé¼®ÖÐÌôÑ¡³öÀ´Ò»Ð©£¬°´ÕÕѧϰµÄÏȺó˳Ðò£¬ÍƼö¸ø´ó¼Ò£¬ÌرðÊÇÄÇЩÏë²»¶ÏÌá¸ß×Ô¼º¼¼ÊõˮƽµÄJava³ÌÐòÔ±ÃÇ¡£
¡¡¡¡Ò»¡¢Java±à³ÌÈëÃÅÀà
¡¡¡¡¶ÔÓÚûÓÐJava±à³Ì¾ÑéµÄJava³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶ÁʲôÈëÃÅÊé ......
1.
public class EasyError1 {
class Student {
private String name;
public String getName() {
......
Java 1.5ÒÔÉ϶¼ÔÚÐéÄâ»úÀïÄÚ½¨Á˳ÌÐòÐÔÄܸú×ٵŦÄÜ£¬²¢ÌṩÁËJava Profiling API£¬¼ò³ÆJPA£¬Äã¿ÉÒÔËÑË÷'java
profiling'¡£JavaÒ²ÌṩÁ˼òµ¥µÄÐÔÄÜÐÔÄܸú×Ù¹¤¾ßJConsole£¬ÄÜÏÔʾÄڴ棬Ï̵߳ÈʹÓÃ×´¿ö¡£ÁíÍâÒ²ÊÇÓÉSunÌṩ£¬µ«²»°üº¬ÔÚjdk
ÀïµÄ¹¤¾ßvisualgc¿ÉÒÔͼÐη½Ê½ÏÔʾÀ¬»øÊÕ¼¯µÄÔËÐÐÇé¿ö£¬ÎªÐÔÄÜ·ÖÎöÌṩ֧³Ö¡£µÚÈý· ......