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

JavaÄÚ´æ¹ÜÀí

JavaÄÚ´æ¹ÜÀí£¨Ò»¡¢ÄÚ´æ·ÖÅ䣩
¹Ø¼ü×Ö: ÄÚ´æ·ÖÅ䣬³£Á¿³Ø
Ò»¡¢JavaÄÚ´æ·ÖÅä
1¡¢ JavaÓм¸ÖÖ´æ´¢ÇøÓò£¿
* ¼Ä´æÆ÷
    -- ÔÚCPUÄÚ²¿£¬¿ª·¢ÈËÔ±²»ÄÜͨ¹ý´úÂëÀ´¿ØÖƼĴæÆ÷µÄ·ÖÅ䣬ÓɱàÒëÆ÷À´¹ÜÀí
* Õ»
    -- ÔÚWindowsÏÂ, Õ»ÊÇÏòµÍµØÖ·À©Õ¹µÄÊý¾Ý½á¹¹£¬ÊÇÒ»¿éÁ¬ÐøµÄÄÚ´æµÄÇøÓò£¬¼´Õ»¶¥µÄµØÖ·ºÍÕ»µÄ×î´óÈÝÁ¿ÊÇϵͳԤÏȹ涨ºÃµÄ¡£
    -- Óŵ㣺ÓÉϵͳ×Ô¶¯·ÖÅ䣬ËٶȽϿ졣
    -- ȱµã£º²»¹»Áé»î£¬µ«³ÌÐòÔ±ÊÇÎÞ·¨¿ØÖƵġ£
    -- ´æ·Å»ù±¾Êý¾ÝÀàÐÍ¡¢¿ª·¢¹ý³ÌÖоʹ´½¨µÄ¶ÔÏó(¶ø²»ÊÇÔËÐйý³ÌÖÐ)
* ¶Ñ
    -- ÊÇÏò¸ßµØÖ·À©Õ¹µÄÊý¾Ý½á¹¹£¬ÊDz»Á¬ÐøµÄÄÚ´æÇøÓò
    -- ÔÚ¶ÑÖУ¬Ã»ÓжÑÕ»Ö¸Õ룬Ϊ´ËÒ²¾ÍÎÞ·¨Ö±½Ó´Ó´¦ÀíÆ÷ÄDZ߻ñµÃÖ§³Ö
    -- ¶ÑµÄºÃ´¦ÊÇÓкܴóµÄÁé»îÐÔ¡£ÈçJava±àÒëÆ÷²»ÐèÒªÖªµÀ´Ó¶ÑÀïÐèÒª·ÖÅä¶àÉÙ´æ´¢ÇøÓò£¬Ò²²»±ØÖªµÀ´æ´¢µÄÊý¾ÝÔÚ¶ÑÀï»á´æ»î¶à³¤Ê±¼ä¡£
* ¾²Ì¬´æ´¢ÇøÓòÓë³£Á¿´æ´¢ÇøÓò
    -- ¾²Ì¬´æ´¢ÇøÓÃÀ´´æ·ÅstaticÀàÐ͵ıäÁ¿
    -- ³£Á¿´æ´¢ÇøÓÃÀ´´æ·Å³£Á¿ÀàÐÍ(final)ÀàÐ͵ÄÖµ£¬Ò»°ãÔÚÖ»¶Á´æ´¢Æ÷ÖÐ
* ·ÇRAM´æ´¢
    -- ÈçÁ÷¶ÔÏó£¬ÊÇÒª·¢Ë͵½ÁíÍâһ̨»úÆ÷ÉϵÄ
    -- ³Ö¾Ã»¯µÄ¶ÔÏ󣬴æ·ÅÔÚ´ÅÅÌÉÏ
2¡¢ javaÄÚ´æ·ÖÅä
    -- »ù´¡Êý¾ÝÀàÐÍÖ±½ÓÔÚÕ»¿Õ¼ä·ÖÅä;
    -- ·½·¨µÄÐÎʽ²ÎÊý£¬Ö±½ÓÔÚÕ»¿Õ¼ä·ÖÅ䣬µ±·½·¨µ÷ÓÃÍê³Éºó´ÓÕ»¿Õ¼ä»ØÊÕ;
    -- ÒýÓÃÊý¾ÝÀàÐÍ£¬ÐèÒªÓÃnewÀ´´´½¨£¬¼ÈÔÚÕ»¿Õ¼ä·ÖÅäÒ»¸öµØÖ·¿Õ¼ä£¬ÓÖÔڶѿռä·ÖÅä¶ÔÏóµÄÀà±äÁ¿;
    -- ·½·¨µÄÒýÓòÎÊý£¬ÔÚÕ»¿Õ¼ä·ÖÅäÒ»¸öµØÖ·¿Õ¼ä£¬²¢Ö¸Ïò¶Ñ¿Õ¼äµÄ¶ÔÏóÇø£¬µ±·½·¨µ÷ÓÃÍêºó´ÓÕ»¿Õ¼ä»ØÊÕ;
    -- ¾Ö²¿±äÁ¿ new ³öÀ´Ê±£¬ÔÚÕ»¿Õ¼äºÍ¶Ñ¿Õ¼äÖзÖÅä¿Õ¼ä£¬µ±¾Ö²¿±äÁ¿ÉúÃüÖÜÆÚ½áÊøºó£¬Õ»¿Õ¼äÁ¢¿Ì±»»ØÊÕ£¬¶Ñ¿Õ¼äÇøÓòµÈ´ýGC»ØÊÕ;
    -- ·½·¨µ÷ÓÃʱ´«ÈëµÄ literal ²ÎÊý£¬ÏÈÔÚÕ»¿Õ¼ä·ÖÅ䣬ÔÚ·½·¨µ÷ÓÃÍê³Éºó´ÓÕ»¿Õ¼äÊÍ·Å;
    -- ×Ö·û´®³£Á¿ÔÚ DATA ÇøÓò·ÖÅä £¬this Ôڶѿռä·ÖÅä;
    -- Êý×é¼ÈÔÚÕ»¿Õ¼ä·ÖÅäÊý×éÃû³Æ£¬ ÓÖÔڶѿռä·ÖÅäÊý×éʵ¼ÊµÄ´óС£¡
3¡¢JavaÄÚ´æÄ£ÐÍ
* JavaÐéÄâ»ú½«Æä¹ÜϽµÄÄÚ´æ´óÖ·ÖÈý¸öÂß¼­²¿·Ö£º·½·¨Çø(Method Area)¡¢JavaÕ»ºÍJava¶Ñ¡£
    -- ·½·¨ÇøÊǾ²Ì¬·ÖÅäµÄ£¬±àÒëÆ÷½«±äÁ¿ÔÚ°ó¶¨ÔÚ


Ïà¹ØÎĵµ£º

JavaÊý¾Ý¿âÁ¬½Ó´óÈ«

1       Java Á¬½Ó Oralce
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl";  
Connection conn= DriverManager.getConnection(url,user,password);
2       Java Á¬½ ......

JavaÖÐÈ¡µ±Ç°µÄ·½·¨Ãû×Ö

stack[0] ±íʾ»ñµÃµ±Ç°·½·¨
1.
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
stack[0].getMethodName();
    StackTraceElement[] stack = Thread.currentThread().getStackTrace();
    stack[
0
].getMethodName(); 
new Exceptio ......

java staticºÍfinalµÄÀí½â

final ¹Ø¼ü×Ö ºÍ static Ó÷¨
Ò»¡¢final 
¸ù¾Ý³ÌÐòÉÏÏÂÎÄ»·¾³£¬Java¹Ø¼ü×ÖfinalÓГÕâÊÇÎÞ·¨¸Ä±äµÄ”»òÕß“ÖÕ̬µÄ”º¬Ò壬Ëü¿ÉÒÔÐÞÊηdzéÏóÀà¡¢·Ç³éÏóÀà³ÉÔ±·½·¨ºÍ±äÁ¿¡£Äã¿ÉÄܳöÓÚÁ½ÖÖÀí½â¶øÐèÒª×èÖ¹¸Ä±ä£ºÉè¼Æ»òЧÂÊ¡£
finalÀ಻Äܱ»¼Ì³Ð£¬Ã»ÓÐ×ÓÀ࣬finalÀàÖеķ½·¨Ä¬ÈÏÊÇfinalµÄ¡£ 
......

¼òµ¥JAVA socket ±Ê¼Ç

Server£º
                ServerSocket server = new ServerSocket(PORT, 1);  // ´ò¿ªServer²¢¼àÌý
                Socket client = server.accept(); ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ