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

java ÐéÄâ»úÔËÐÐʱÊý¾ÝÇøÓò Runtime Data Areas

The Java virtual machine defines various runtime data areas that are used during execution of a program. Some of these data areas are created on Java virtual machine start-up and are destroyed only when the Java virtual machine exits. Other data areas are per thread. Per-thread data areas are created when a thread is created and destroyed when the thread exits.
ÐéÄâ»ú¶¨ÒåÁ˸÷ÖÖÔËÐÐʱÊý¾ÝÇøÒÔ±¸³ÌÐòÔËÐÐʱÀûÓá£Ò»²¿·ÝÔÚÐéÄâ»úÆô¶¯Ê±±»´´½¨£¬ÔÚÐéÄâ»úÍ˳öʱ±»Ïú»Ù¡£ÁíÒ»²¿·Ý¸úÏß³ÌÓйأ¬ÔÚÏ̴߳´½¨Ê±±»´´½¨£¬Ïß³ÌÍ˳öʱ±»Ïú»Ù¡£
3.5.1 The pc Register ¼Ä´æÆ÷
The Java virtual machine can support many threads of execution at once (§2.19). Each Java virtual machine thread has its own pc (program counter) register. At any point, each Java virtual machine thread is executing the code of a single method, the current method (§3.6) for that thread. If that method is not native, the pc register contains the address of the Java virtual machine instruction currently being executed. If the method currently being executed by the thread is native, the value of the Java virtual machine's pc register is undefined. The Java virtual machine's pc register is wide enough to hold a returnAddress or a native pointer on the specific platform.
ÐéÄâ»úÖ§³Ö¶àỊ̈߳¬Ã¿Ò»¸öÏ̶߳¼ÓµÓÐ×Ô¼ºµÄ¼Ä´æÆ÷¡£ÔÚÈÎÒ»µã£¬Ã¿¸öÐéÄâ»úÏ̶߳¼Ö´ÐÐÌض¨´úÂ룬µ±Ç°·½·¨¡£Èç¹û´Ë·½·¨²»Êʱ¾µØµÄ£¬
3.5.2 Java Virtual Machine Stacks ÐéÄâ»úÕ»
Each Java virtual machine thread has a private Java virtual machine stack, created at the same time as the thread.3 A Java virtual machine stack stores frames (§3.6). A Java virtual machine stack is analogous to the stack of a conventional language such as C: it holds local variables and partial results, and plays a part in method invocation and return. Because the Java virtual machine stack is never manipulated directly except to push and pop frames, frames may be heap allocated. The memory for a Java virtual machine stack does not need to be contiguous.
The Java virtual machine


Ïà¹ØÎĵµ£º

JavaµÄFilter Ò»£º£¨×ªÔØ£©


 
 
¹Ø¼ü×Ö: filter
    ¹ýÂËÆ÷FilterÒ²¾ßÓÐÉúÃüÖÜÆÚ£ºinit()->doFilter()->destroy()£¬Óɲ¿ÊðÎļþÖеÄfilterÔªËØÇý¶¯¡£ÔÚservlet2.4ÖУ¬¹ýÂËÆ÷ͬÑù¿ÉÒÔÓÃÓÚÇëÇó·ÖÅÉÆ÷£¬µ«ÐëÔÚweb.xmlÖÐÉùÃ÷£¬<dispatcher>INCLUDE»òFORWARD»òREQUEST»òERROR</dispatcher>¸ÃÔªËØλÓÚfilter ......

Java±à³ÌÄÇЩʶù70——³éÏóÀàºÍ½Ó¿Ú(Èý)

8.9.3 ³éÏóÀàºÍ½Ó¿ÚµÄ±È½Ï
         ³éÏóÀàºÍ½Ó¿Ú¶¼ÊǽøÐÐÃæÏò¶ÔÏóÉè¼ÆʱרÓõÄÉè¼Æ½á¹¹£¬ÔÚʵ¼Ê½øÐÐÏîÄ¿Éè¼Æʱ£¬¾­³£ÐèÒª¿¼ÂǵÄÎÊÌâ¾ÍÊÇ——“ʹÓóéÏóÀ໹Êǽӿڔ£¿ÏÂÃæͨ¹ý¶ÔÓÚ³éÏóÀàºÍ½Ó¿Ú½øÐмòµ¥µÄ±È½Ï£¬ÊìϤÁ½ÕßÖ®¼äµÄÇø±ðºÍÁªÏµ£¬´Ó¶øÔÚʵ¼ÊÉè¼ÆÊ±Ê ......

ΪʲôÈç´Ë»ñÈ¡JavaÊý×éµÄ³¤¶È

¼ÇµÃvamcily ÔøÎÊÎÒ£º“Ϊʲô»ñÈ¡Êý×éµÄ³¤¶ÈÓÃ.length(³ÉÔ±±äÁ¿µÄÐÎʽ)£¬¶ø»ñÈ¡StringµÄ³¤¶ÈÓÃ.length()(³ÉÔ±·½·¨µÄÐÎʽ)£¿”
ÎÒµ±Ê±Ò»Ìý£¬¾õµÃÎʵúÜÓеÀÀí¡£×öͬÑùÒ»¼þÊÂÇ飬Ϊʲô²ÉÓÃÁ½ÖÖ·ç¸ñåÄÒìµÄ·ç¸ñÄØ£¿¿öÇÒ£¬JavaÖеÄÊý×éÆäʵÊÇÍ걸(full-fledged)µÄ¶ÔÏó£¬Ö±½Ó±©Â¶³ÉÔ±±äÁ¿£¬¿ÉÄܲ»ÊÇÒ»ÖÖºÜOOµÄ·ç¸ñ¡£ ......

JavaÑ¡ÔñÌâ

Ñ¡ÔñÌâ
3ÔĶÁһϳÌÐò£º
Boolean a=false;
Boolean b=true;
Boolean c=(a&b)&&(!b);
Int result=b==false?1:2;
Õâ¶Î³ÌÐòÖ´ÐÐÍêºó£¬cÓëresultµÄÖµÊÇ£¨D£©¡£
A  c=false; result=1;  B. c=true;result=2;
C£®c=true;result=1   D. c=false; result=2
 
6.ÏÂÊöÉùÃ÷ÖÐÄÄÖÖ¿É·À ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ