JavaỊ̈߳ºÏß³Ì״̬µÄת»»
JavaỊ̈߳ºÏß³Ì״̬µÄת»»
SCJP5ѧϰ±Ê¼Ç
Ò»¡¢Ïß³Ì״̬
Ï̵߳Ä״̬ת»»ÊÇÏ߳̿ØÖƵĻù´¡¡£Ïß³Ì״̬×ܵĿɷÖΪÎå´ó״̬£º·Ö±ðÊÇÉú¡¢ËÀ¡¢¿ÉÔËÐС¢ÔËÐС¢µÈ´ý/×èÈû¡£ÓÃÒ»¸öͼÀ´ÃèÊöÈçÏ£º
1¡¢ÐÂ״̬£ºÏ̶߳ÔÏóÒѾ´´½¨£¬»¹Ã»ÓÐÔÚÆäÉϵ÷ÓÃstart()·½·¨¡£
2¡¢¿ÉÔËÐÐ״̬£ºµ±Ïß³ÌÓÐ×ʸñÔËÐУ¬µ«µ÷¶È³ÌÐò»¹Ã»ÓаÑËüÑ¡¶¨ÎªÔËÐÐÏß³ÌʱÏß³ÌËù´¦µÄ״̬¡£µ±start()·½·¨µ÷ÓÃʱ£¬Ïß³ÌÊ×ÏȽøÈë¿ÉÔËÐÐ״̬¡£ÔÚÏß³ÌÔËÐÐÖ®ºó»òÕß´Ó×èÈû¡¢µÈ´ý»ò˯Ãß״̬»ØÀ´ºó£¬Ò²·µ»Øµ½¿ÉÔËÐÐ״̬¡£
3¡¢ÔËÐÐ״̬£ºÏ̵߳÷¶È³ÌÐò´Ó¿ÉÔËÐгØÖÐÑ¡ÔñÒ»¸öÏß³Ì×÷Ϊµ±Ç°Ïß³ÌʱÏß³ÌËù´¦µÄ״̬¡£ÕâÒ²ÊÇÏ߳̽øÈëÔËÐÐ״̬µÄΨһһÖÖ·½Ê½¡£
4¡¢µÈ´ý/×èÈû/˯Ãß״̬£ºÕâÊÇÏß³ÌÓÐ×ʸñÔËÐÐʱËüËù´¦µÄ״̬¡£Êµ¼ÊÉÏÕâ¸öÈý״̬×éºÏΪһÖÖ£¬Æ乲ͬµãÊÇ£ºÏß³ÌÈÔ¾ÉÊÇ»îµÄ£¬µ«Êǵ±Ç°Ã»ÓÐÌõ¼þÔËÐС£»»¾ä»°Ëµ£¬ËüÊÇ¿ÉÔËÐеģ¬µ«ÊÇÈç¹ûij¼þʼþ³öÏÖ£¬Ëû¿ÉÄÜ·µ»Øµ½¿ÉÔËÐÐ״̬¡£
5¡¢ËÀÍö̬£ºµ±Ï̵߳Ärun()·½·¨Íê³Éʱ¾ÍÈÏΪËüËÀÈ¥¡£Õâ¸öÏ̶߳ÔÏóÒ²ÐíÊÇ»îµÄ£¬µ«ÊÇ£¬ËüÒѾ²»ÊÇÒ»¸öµ¥¶ÀÖ´ÐеÄÏ̡߳£Ïß³ÌÒ»µ©ËÀÍö£¬¾Í²»Äܸ´Éú¡£ Èç¹ûÔÚÒ»¸öËÀÈ¥µÄÏß³ÌÉϵ÷ÓÃstart()·½·¨£¬»áÅ׳öjava.lang.IllegalThreadStateExceptionÒì³£¡£
ÓйØÏêϸ״̬ת»»Í¼¿ÉÒԲο´±¾È˵ēJava¶àÏ̱߳à³Ì×ܽá”ÖеÄͼ
¶þ¡¢×èÖ¹Ïß³ÌÖ´ÐÐ
¶ÔÓÚÏ̵߳Ä×èÖ¹£¬¿¼ÂÇÒ»ÏÂÈý¸ö·½Ã棬²»¿¼ÂÇIO×èÈûµÄÇé¿ö£º
˯Ãߣ»
µÈ´ý£»
ÒòΪÐèÒªÒ»¸ö¶ÔÏóµÄËø¶¨¶ø±»×èÈû¡£
1¡¢Ë¯Ãß
Thread.sleep(long millis)ºÍThread.sleep(long millis, int nanos)¾²Ì¬·½·¨Ç¿ÖƵ±Ç°ÕýÔÚÖ´ÐеÄÏß³ÌÐÝÃߣ¨ÔÝÍ£Ö´ÐУ©£¬ÒÔ“¼õÂýÏ߳̔¡£µ±Ïß³Ì˯Ãßʱ£¬ËüÈë˯ÔÚij¸öµØ·½£¬ÔÚËÕÐÑ֮ǰ²»»á·µ»Øµ½¿ÉÔËÐÐ״̬¡£µ±Ë¯Ãßʱ¼äµ½ÆÚ£¬Ôò·µ»Øµ½¿ÉÔËÐÐ״̬¡£
Ïß³Ì˯ÃßµÄÔÒò£ºÏß³ÌÖ´ÐÐÌ«¿ì£¬»òÕßÐèҪǿÖƽøÈëÏÂÒ»ÂÖ£¬ÒòΪJava¹æ·¶²»±£Ö¤ºÏÀíµÄÂÖ»»¡£
˯ÃßµÄʵÏÖ£ºµ÷Óþ²Ì¬·½·¨¡£
try {
Thread.sleep(123);
} catch (InterruptedException e) {
e.printStackTrace();
&nb
Ïà¹ØÎĵµ£º
Ä¿Ç°ÍøÂçÉϹØÓÚ¶ÔÏóÐòÁл¯µÄÎÄÕ²»ÉÙ£¬µ«ÊÇÎÒ·¢ÏÖÏêϸÐðÊöÓ÷¨ºÍÔÀíµÄÎÄÕÂÌ«ÉÙ¡£±¾ÈË°Ñ×Ô¼º¾¹ý¾Ñé×ܽáºÍʵ¼ÊÔËÓÃÖеÄÌå»áд³ÉµÄѧϰ±Ê¼Ç¹±Ï׸ø´ó¼Ò¡£Ï£ÍûÄÜΪÕû¸öjavaÉçÇøµÄ·±ÈÙ×öÒ»µãÊÂÇé¡£
¡¡¡¡ÐòÁл¯µÄ¹ý³Ì¾ÍÊǶÔÏóдÈë×Ö½ÚÁ÷ºÍ´Ó×Ö½ÚÁ÷ÖжÁÈ¡¶ÔÏó¡£½«¶ÔÏó״̬ת»»³É×Ö½ÚÁ÷Ö®ºó£¬¿ÉÒÔÓÃjava.io°üÖеĸ÷ÖÖ×Ö½ÚÁ÷Àà½«Æ ......
JAVA·´Éä»úÖÆÊÇÔÚÔËÐÐ״̬ÖУ¬¶ÔÓÚÈÎÒâÒ»¸öÀ࣬¶¼Äܹ»ÖªµÀÕâ¸öÀàµÄËùÓÐÊôÐԺͷ½·¨£»¶ÔÓÚÈÎÒâÒ»¸ö¶ÔÏ󣬶¼Äܹ»µ÷ÓÃËüµÄÈÎÒâÒ»¸ö·½·¨£»ÕâÖÖ¶¯Ì¬»ñÈ¡µÄÐÅÏ¢ÒÔ¼°¶¯Ì¬µ÷ÓöÔÏóµÄ·½·¨µÄ¹¦ÄܳÆΪjavaÓïÑԵķ´Éä»úÖÆ¡£
package mypakage;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; ......
JAVA¿ÉÒÔ˵ÊÇ´ÓC++·¢Õ¹ÆðÀ´µÄÍêÈ«ÃæÏò¶ÔÏóµÄ¿ª·¢ÓïÑÔ,Á½ÕßµÄʵÖÊÇø±ðÊÇÀûÒæ·ÖÊô²»Í¬µÄ¹«Ë¾:SUNºÍ΢Èí.¶Ô´Ë΢Èí·¢²¼ÁË.NETÓëÖ®¿¹ºâ.
´Ó×îеÄVisual Studio .NET 2005¿´,.NETÖ÷ÒªÊÇ4ÖÖÓïÑÔ:VB.NET, C#, C++.NET, J#.
VB.NET¿ÉÒÔ˵ÊÇVB6µÄÉý¼¶,µ«ÎÒÈÏΪVB.NETºÍC#ÒѾÊÇÍêȫȫеÄÓïÑÔÁË,Á½ÕßµÄÄ¿µÄ¶¼ÊÇÒª´ò°ÜJAVAÕâ¸ö¾ºÕù¶ ......
commons-digester.jar
Digester»ùÓÚ¹æÔòµÄXMLÎĵµ½âÎö,Ö÷ÒªÓÃÓÚXMLµ½Java¶ÔÏóµÄÓ³Éä.
commons-beanutils.jar
Ìṩ¶ÔJava ·´ÉäºÍ×ÔÊ¡APIµÄ°ü×°.
aspectjweaver.jar
ÓÃÓÚÔÚSpring 2.0Öм¯³ÉAspectJ AspectJ LTWÖ¯ÈëÆ÷
ognl.jar
OGNLÊÇObject-Graph Navigation LanguageµÄËõд£¬ËüÊÇÒ»ÖÖ¹¦ÄÜÇ¿´óµÄ±í´ïʽÓïÑÔ£¨E ......
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class JavaBasic {
public static void main(String[] args){
StringBuffer sd = new StringBuffer();
String hhhString="adlkll";
&nbs ......