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

java»ù´¡ÎÊ´ð£¨3£©

21¡¢Static Nested Class ºÍ Inner ClassµÄ²»Í¬¡£ Static Nested ClassÊDZ»ÉùÃ÷Ϊ¾²Ì¬£¨static£©µÄÄÚ²¿À࣬Ëü¿ÉÒÔ²»ÒÀÀµÓÚÍⲿÀàʵÀý±»ÊµÀý»¯¡£¶øͨ³£µÄÄÚ²¿ÀàÐèÒªÔÚÍⲿÀàʵÀý»¯ºó²ÅÄÜʵÀý»¯¡£
 22¡¢JSPÖж¯Ì¬INCLUDEÓ뾲̬INCLUDEµÄÇø±ð£¿¶¯Ì¬INCLUDEÓÃjsp:include¶¯×÷ʵÏÖ Ëü×ÜÊÇ»á¼ì²éËùº¬ÎļþÖеı仯£¬ÊʺÏÓÃÓÚ°üº¬¶¯Ì¬Ò³Ã棬²¢ÇÒ¿ÉÒÔ´ø²ÎÊý¡£¾²Ì¬INCLUDEÓÃincludeαÂëʵÏÖ,¶¨²»»á¼ì²éËùº¬ÎļþµÄ±ä»¯£¬ÊÊÓÃÓÚ°üº¬¾²Ì¬Ò³Ãæ<--include file="included.htm"-->
 23¡¢Ê²Ã´Ê±ºòÓÃassert¡£ assertion(¶ÏÑÔ)ÔÚÈí¼þ¿ª·¢ÖÐÊÇÒ»ÖÖ³£Óõĵ÷ÊÔ·½Ê½£¬ºÜ¶à¿ª·¢ÓïÑÔÖж¼Ö§³ÖÕâÖÖ»úÖÆ¡£ÔÚʵÏÖÖУ¬assertion¾ÍÊÇÔÚ³ÌÐòÖеÄÒ»ÌõÓï¾ä£¬Ëü¶ÔÒ»¸öboolean±í´ïʽ½øÐмì²é£¬Ò»¸öÕýÈ·³ÌÐò±ØÐë±£Ö¤Õâ¸öboolean±í´ïʽµÄֵΪtrue£»Èç¹û¸ÃֵΪfalse£¬ËµÃ÷³ÌÐòÒѾ­´¦ÓÚ²»ÕýÈ·µÄ״̬Ï£¬ÏµÍ³½«¸ø³ö¾¯¸æ»òÍ˳ö¡£Ò»°ãÀ´Ëµ£¬assertionÓÃÓÚ±£Ö¤³ÌÐò×î»ù±¾¡¢¹Ø¼üµÄÕýÈ·ÐÔ¡£assertion¼ì²éͨ³£ÔÚ¿ª·¢ºÍ²âÊÔʱ¿ªÆô¡£ÎªÁËÌá¸ßÐÔÄÜ£¬ÔÚÈí¼þ·¢²¼ºó£¬assertion¼ì²éͨ³£Êǹرյġ£
24¡¢GCÊÇʲô? ΪʲôҪÓÐGC? ¡¡¡¡GCÊÇÀ¬»øÊÕ¼¯µÄÒâ˼£¨Gabage Collection£©,ÄÚ´æ´¦ÀíÊDZà³ÌÈËÔ±ÈÝÒ׳öÏÖÎÊÌâµÄµØ·½£¬Íü¼Ç»òÕß´íÎóµÄÄÚ´æ»ØÊջᵼÖ³ÌÐò»òϵͳµÄ²»Îȶ¨ÉõÖÁ±ÀÀ££¬JavaÌṩµÄGC¹¦ÄÜ¿ÉÒÔ×Ô¶¯¼à²â¶ÔÏóÊÇ·ñ³¬¹ý×÷ÓÃÓò´Ó¶ø´ïµ½×Ô¶¯»ØÊÕÄÚ´æµÄÄ¿µÄ£¬JavaÓïÑÔûÓÐÌṩÊÍ·ÅÒÑ·ÖÅäÄÚ´æµÄÏÔʾ²Ù×÷·½·¨¡£
25¡¢short s1 = 1; s1 = s1 + 1;ÓÐʲô´í? short s1 = 1; s1 += 1;ÓÐʲô´í? short s1 = 1; s1 = s1 + 1; £¨s1+1ÔËËã½á¹ûÊÇintÐÍ£¬ÐèҪǿÖÆת»»ÀàÐÍ£© short s1 = 1; s1 += 1;£¨¿ÉÒÔÕýÈ·±àÒ룩
26¡¢Math.round(11.5)µÈ춶àÉÙ? Math.round(-11.5)µÈ춶àÉÙ? Math.round(11.5)==12 Math.round(-11.5)==-11 round·½·¨·µ»ØÓë²ÎÊý×î½Ó½üµÄ³¤ÕûÊý£¬²ÎÊý¼Ó1/2ºóÇóÆäfloor.
 27¡¢String s = new String("xyz");´´½¨Á˼¸¸öString Object? Á½¸ö
28¡¢Éè¼Æ4¸öỊ̈߳¬ÆäÖÐÁ½¸öÏß³Ìÿ´Î¶ÔjÔö¼Ó1£¬ÁíÍâÁ½¸öÏ̶߳Ôjÿ´Î¼õÉÙ1¡£Ð´³ö³ÌÐò¡£ÒÔϳÌÐòʹÓÃÄÚ²¿ÀàʵÏÖỊ̈߳¬¶ÔjÔö¼õµÄʱºòûÓп¼ÂÇ˳ÐòÎÊÌâ¡£ public class ThreadTest1{ private int j; public static void main(String args[]){ ThreadTest1 tt=new ThreadTest1(); Inc inc=tt.new Inc(); Dec dec=tt.new Dec(); for(int i=0;i<2;i++){ Thread t=new Thread(inc); t.start(); t=new Thread(dec); t.start(); } } private syn


Ïà¹ØÎĵµ£º

JavaºËÐÄAPIÐèÒªÕÆÎյij̶È

JavaµÄºËÐÄAPIÊǷdz£ÅÓ´óµÄ,Õâ¸ø¿ª·¢ÕßÀ´Ëµ´øÀ´Á˺ܴóµÄ·½±ã£¬¾­³£ÈËÓÐÆÀÂÛ,javaÈóÌÐòÔ±±äɵ¡£
µ«ÊÇһЩÄÚÈÝÎÒÈÏΪÊDZØÐëÕÆÎյģ¬·ñÔò²»¿ÉÒÔÊìÁ·ÔËÓÃjava£¬Ò²²»»áʹÓþͺÜÄÑ°ìÁË¡£
1¡¢java.lang°üϵÄ80£¥ÒÔÉϵÄÀàµÄ¹¦ÄܵÄÁé»îÔËÓá£
2¡¢java.util°üϵÄ80£¥ÒÔÉϵÄÀàµÄÁé»îÔËÓã¬ÌرðÊǼ¯ºÏÀàÌåϵ¡¢Õý¹æ±í´ïʽ¡¢Ê±¼ä¡¢Ê ......

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

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

JavaÄÚ´æ¹ÜÀí

JavaÄÚ´æ¹ÜÀí
¹Ø¼ü×Ö: ÄÚ´æ·ÖÅ䣬³£Á¿³Ø
Ò»¡¢JavaÄÚ´æ·ÖÅä
1¡¢ JavaÓм¸ÖÖ´æ´¢ÇøÓò£¿
* ¼Ä´æÆ÷
    -- ÔÚCPUÄÚ²¿£¬¿ª·¢ÈËÔ±²»ÄÜͨ¹ý´úÂëÀ´¿ØÖƼĴæÆ÷µÄ·ÖÅ䣬ÓɱàÒëÆ÷À´¹ÜÀí
* Õ»
    -- ÔÚWindowsÏÂ, Õ»ÊÇÏòµÍµØÖ·À©Õ¹µÄÊý¾Ý½á¹¹£¬ÊÇÒ»¿éÁ¬ÐøµÄÄÚ´æµÄÇøÓò£¬¼´Õ»¶¥µÄµØÖ·ºÍÕ»µÄ×î´óÈÝÁ¿ÊÇ ......

Javaͨ¹ýcommons net.jar°üÉÏ´«ftpÎļþ£¨ÑùÀý£©

public class FtpTest {
 public FtpTest() {
  // TODO Auto-generated constructor stub
 }
 /**
  * ÉÏ´«ftpÎļþ
  * @param upFile  ÉÏ´«ÎļþÏêϸÐÅÏ¢
  * @param upDirectory  ÉÏ´«ftpĿ¼
  */
 public static void ftpUpload(String upFile,S ......

JavaÔ¶³ÌͨѶÏà¹Ø¼¼Êõ

Ò»¡¢»ùÓÚRMIµÄÒ»´ÎÍêÕûµÄÔ¶³ÌͨÐŹý³ÌµÄÔ­Àí£º
1. ¿Í»§¶Ë·¢ÆðÇëÇó£¬ÇëÇóת½»ÖÁRMI¿Í»§¶ËµÄstubÀࣻ
2. stubÀཫÇëÇóµÄ½Ó¿Ú¡¢·½·¨¡¢²ÎÊýµÈÐÅÏ¢½øÐÐÐòÁл¯£»
3. »ùÓÚsocket½«ÐòÁл¯ºóµÄÁ÷´«ÊäÖÁ·þÎñÆ÷¶Ë£»
4. ·þÎñÆ÷¶Ë½ÓÊÕµ½Á÷ºóת·¢ÖÁÏàÓ¦µÄskeltonÀࣻ
5. skeltonÀཫÇëÇóµÄÐÅÏ¢·´ÐòÁл¯ºóµ÷ÓÃʵ¼ÊµÄ´¦ÀíÀࣻ
6. ´¦Àí ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ