JavaỊ̈߳ºÏ̵߳ĵ÷¶È ÊØ»¤Ïß³Ì
JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÊØ»¤Ïß³Ì
ÊØ»¤Ïß³ÌÓëÆÕͨÏß³Ìд·¨ÉÏ»ù±¾Ã´É¶Çø±ð£¬µ÷ÓÃÏ̶߳ÔÏóµÄ·½·¨setDaemon(true)£¬Ôò¿ÉÒÔ½«ÆäÉèÖÃΪÊØ»¤Ï̡߳£
ÊØ»¤Ïß³ÌʹÓõÄÇé¿ö½ÏÉÙ£¬µ«²¢·ÇÎÞÓ㬾ÙÀýÀ´Ëµ£¬JVMµÄÀ¬»ø»ØÊÕ¡¢ÄÚ´æ¹ÜÀíµÈÏ̶߳¼ÊÇÊØ»¤Ï̡߳£»¹ÓоÍÊÇÔÚ×öÊý¾Ý¿âÓ¦ÓÃʱºò£¬Ê¹ÓõÄÊý¾Ý¿âÁ¬½Ó³Ø£¬Á¬½Ó³Ø±¾ÉíÒ²°üº¬×źܶàºǫ́Ị̈߳¬¼à¿ØÁ¬½Ó¸öÊý¡¢³¬Ê±Ê±¼ä¡¢×´Ì¬µÈµÈ¡£
setDaemon·½·¨µÄÏêϸ˵Ã÷£º
public final void setDaemon(boolean on)½«¸ÃÏ̱߳ê¼ÇΪÊØ»¤Ï̻߳òÓû§Ï̡߳£µ±ÕýÔÚÔËÐеÄÏ̶߳¼ÊÇÊØ»¤Ïß³Ìʱ£¬Java ÐéÄâ»úÍ˳ö¡£
¸Ã·½·¨±ØÐëÔÚÆô¶¯Ïß³ÌÇ°µ÷Óá£
¸Ã·½·¨Ê×Ïȵ÷ÓøÃÏß³ÌµÄ checkAccess ·½·¨£¬ÇÒ²»´øÈκβÎÊý¡£Õâ¿ÉÄÜÅ׳ö SecurityException£¨ÔÚµ±Ç°Ïß³ÌÖУ©¡£
²ÎÊý£º
on - Èç¹ûΪ true£¬Ôò½«¸ÃÏ̱߳ê¼ÇΪÊØ»¤Ï̡߳£
Å׳ö£º
IllegalThreadStateException - Èç¹û¸ÃÏ̴߳¦Óڻ״̬¡£
SecurityException - Èç¹ûµ±Ç°Ïß³ÌÎÞ·¨Ð޸ĸÃÏ̡߳£
ÁíÇë²Î¼û£º
isDaemon(), checkAccess()
/**
* JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÊØ»¤Ïß³Ì
*
* @author leizhimin 2009-11-4 9:02:40
*/
public class Test {
public static void main(String[] args) {
Thread t1 = new MyCommon();
Thread t2 = new Thread(new MyDaemon());
t2.setDaemon(true); //ÉèÖÃΪÊØ»¤Ïß³Ì
t2.start();
 
Ïà¹ØÎĵµ£º
½«´«ÈëµÄÈÎÒâÖÐÎÄ×Ö·ûת»»ÎªÆ´Òô
£¨1£©¶àÒô×ÖֻȡÆäÖÐÒ»¸ö¶ÁÒô¡£
£¨2£©ÉúƧ×ÖÈç¹ûûÓÐÆ´Òô£¬Ê¹ÓÃunknownÌæ´ú¡£
package com.amgotech;
public class ChineseSpelling
{
private static int[] pyvalue = new int[] { -20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20 ......
ÔÎijö´¦£ºhttp://java.csdn.net/a/20100308/259219.html
Ãô½Ý¿ª·¢µÄÀíÄîÒѾÁ÷ÐÐÁ˺ܳ¤µÄʱ¼ä£¬ÔÚÃô½Ý¿ª·¢ÖеĿª·¢µü´ú½×¶ÎÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýÎå¸ö²½Ö裬À´ÓÐЧµÄÌá¸ßÕû¸öÏîÄ¿µÄ´úÂëÖÊÁ¿¡£
JavaÏîÄ¿¿ª·¢¹ý³ÌÖУ¬ÓÉÓÚ¿ª·¢ÈËÔ±µÄ¾Ñé¡¢Java´úÂë±àдϰ¹ß£¬ÒÔ¼°È±·¦Í³Ò»µÄ±ê×¼ºÍ¹ÜÀíÁ÷³Ì£¬ÍùÍùµ¼ÖÂÕû¸öÏîÄ¿µÄ´úÂëÖÊÁ¿½Ï²î£¬ÄÑÓ ......
Öµ´«µÝ£º·½·¨µ÷ÓÃʱ£¬Êµ¼Ê²ÎÊý°ÑËüµÄÖµ´«µÝ¸ø¶ÔÓ¦µÄÐÎʽ²ÎÊý£¬·½·¨Ö´ÐÐÖÐÐÎʽ²ÎÊýÖµµÄ¸Ä±ä²»Ó°Ïìʵ¼Ê²Î ÊýµÄÖµ¡£
ÒýÓô«µÝ£ºÒ²³ÆΪ´«µØÖ·¡£·½·¨µ÷ÓÃʱ£¬Êµ¼Ê²ÎÊýµÄÒýÓÃ(µØÖ·£¬¶ø²»ÊDzÎÊýµÄÖµ)±»´«µÝ¸ø·½·¨ÖÐÏà¶ÔÓ¦µÄÐÎʽ²ÎÊý£¬ÔÚ·½·¨Ö´ÐÐÖУ¬¶ÔÐÎʽ²ÎÊýµÄ²Ù×÷ʵ¼ÊÉϾÍÊǶÔʵ¼Ê²ÎÊýµÄ²Ù×÷£¬·½·¨Ö´ÐÐÖÐÐÎʽ²ÎÊýÖµµÄ¸Ä±ä ......
Ãô½Ý¿ª·¢µÄÀíÄîÒѾÁ÷ÐÐÁ˺ܳ¤µÄʱ¼ä£¬ÔÚÃô½Ý¿ª·¢ÖеĿª·¢µü´ú½×¶ÎÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýÎå¸ö²½Ö裬À´ÓÐЧµÄÌá¸ßÕû¸öÏîÄ¿µÄ´úÂëÖÊÁ¿¡£
JavaÏîÄ¿¿ª·¢¹ý³ÌÖУ¬ÓÉÓÚ¿ª·¢ÈËÔ±µÄ¾Ñé¡¢Java´úÂë±àдϰ¹ß£¬ÒÔ¼°È±·¦Í³Ò»µÄ±ê×¼ºÍ¹ÜÀíÁ÷³Ì£¬ÍùÍùµ¼ÖÂÕû¸öÏîÄ¿µÄ´úÂëÖÊÁ¿½Ï²î£¬ÄÑÓÚά
»¤£¬ÐèÒª½Ï´óµÄ²âÊÔͶÈëºÍÖÜÆÚµÈÎÊÌâ¡£ÕâЩÎÊÌâÔÚÒ»¸ ......
JavaỊ̈߳º¸ÅÄîÓëÔÀí
SCJP5ѧϰ±Ê¼Ç
Ò»¡¢²Ù×÷ϵͳÖÐÏ̺߳ͽø³ÌµÄ¸ÅÄî
ÏÖÔڵIJÙ×÷ϵͳÊǶàÈÎÎñ²Ù×÷ϵͳ¡£¶àÏß³ÌÊÇʵÏÖ¶àÈÎÎñµÄÒ»ÖÖ·½Ê½¡£
½ø³ÌÊÇÖ¸Ò»¸öÄÚ´æÖÐÔËÐеÄÓ¦ÓóÌÐò£¬Ã¿¸ö½ø³Ì¶¼ÓÐ×Ô¼º¶ÀÁ¢µÄÒ»¿éÄÚ´æ¿Õ¼ä£¬Ò»¸ö½ø³ÌÖпÉÒÔÆô¶¯¶à¸öÏ̡߳£±ÈÈçÔÚWindowsϵͳÖУ¬Ò»¸öÔËÐеÄexe¾ÍÊÇÒ»¸ö½ø³Ì¡£
& ......