javaÖÐÕ»(stack)ºÍ¶Ñ(heap)µÄÇø±ð
¼øÓÚÍøÉ϶ÔJavaµÄ¶ÑÕ»Çø·Ö£¬ÖÚ˵·×ç¡£¬ÓеİÑC++µÄ¶ÑÕ»Ò²»ì½øÀ´£¬ÓеÄûÓзÖÇåStack£¬HeapµÄÖÐÎÄ·Ò룬¸ãµÃÎÒ°ÑStackµ±×÷¶Ñ£¬Heapµ±×÷Õ»£¬»ìÂÒÁË£¡×òÌì²Î¼ÓÒ»ÍâÆóµÄ±ÊÊÔ£¬Ñ¡ÔñÓ¢ÎÄ´ð°¸Ê±£¬Ñ¡´íÁË£¬ÖªµÀ´ð°¸ÊǶѣ¬È´Ñ¡ÔñÁËStack£¡½ñÌ죬¾ö¶¨°ÑÁ½ÕßÇø·ÖÇå³þ£¡
Ê×ÏÈ·ÖÇå³þStack£¬HeapµÄÖÐÎÄ·Ò룺Stack—Õ»£¬Heap—¶Ñ¡£
ÔÚÖÐÎÄÀStack¿ÉÒÔ·ÒëΪ“¶ÑÕ»”£¬ËùÒÔÎÒÖ±½Ó²éÕÒÁ˼ÆËã»úÊõÓïÀïÃæ¶ÑºÍÕ»¿ªÍ·µÄ´ÊÓ
¶Ñ´æ´¢£º heapstorage ¶Ñ´æ´¢·ÖÅ䣺 heapstorage allocation ¶Ñ´æ´¢¹ÜÀí£º heap storage management
Õ»±àÖ·£º stack addressing Õ»±ä»»£ºstack transformation Õ»´æ´¢Æ÷£ºstack memory Õ»µ¥Ôª£º stack cell
½Ó×Å£¬×ܽáÔÚJavaÀïÃæHeapºÍStack·Ö±ð´æ´¢Êý¾ÝµÄ²»Í¬¡£
Heap(¶Ñ)
Stack(Õ»)
JVMÖеŦÄÜ
ÄÚ´æÊý¾ÝÇø
ÄÚ´æÖ¸ÁîÇø
´æ´¢Êý¾Ý
¶ÔÏóʵÀý(1)
»ù±¾Êý¾ÝÀàÐÍ, Ö¸Áî´úÂë,³£Á¿,¶ÔÏóµÄÒýÓõØÖ·(2)
1. ±£´æ¶ÔÏóʵÀý£¬Êµ¼ÊÉÏÊDZ£´æ¶ÔÏóʵÀýµÄÊôÐÔÖµ£¬ÊôÐÔµÄÀàÐͺͶÔÏó±¾ÉíµÄÀàÐͱê¼ÇµÈ£¬²¢²»±£´æ¶ÔÏóµÄ·½·¨£¨·½·¨ÊÇÖ¸Á±£´æÔÚstackÖУ©¡£
¶ÔÏóʵÀýÔÚheapÖзÖÅäºÃÒÔºó£¬ÐèÒªÔÚstackÖб£´æÒ»¸ö4×Ö½ÚµÄheapÄÚ´æµØÖ·£¬ÓÃÀ´¶¨Î»¸Ã¶ÔÏóʵÀýÔÚheapÖеÄλÖ㬱ãÓÚÕÒµ½¸Ã¶ÔÏóʵÀý¡£
2. »ù±¾Êý¾ÝÀàÐÍ°üÀ¨byte¡¢int¡¢char¡¢long¡¢float¡¢double¡¢booleanºÍshort¡£
º¯Êý·½·¨ÊôÓÚÖ¸Áî.
=======================
ÒýÓÃÍøÉϹ㷺Á÷´«µÄ“Java¶ÑºÍÕ»µÄÇø
Ïà¹ØÎĵµ£º
WindowsÏÂJAVA»·¾³±äÁ¿µÄÉèÖÃ
WindowsÏÂJAVAÓõ½µÄ»·¾³±äÁ¿Ö÷ÒªÓÐ3¸ö£¬JAVA_HOME¡¢CLASSPATH¡¢PATH¡£ÏÂÃæÖð¸ö·ÖÎö¡£
JAVA_HOME Ö¸ÏòµÄÊÇJDKµÄ°²×°Â·¾¶£¬Èçx:\JDK_1.4.2£¬ÔÚÕâ·¾¶ÏÂÄãÓ¦¸ÃÄܹ»ÕÒµ½bin¡¢libµÈĿ¼¡£ÖµµÃÒ»ÌáµÄÊÇ£¬JDK µÄ°²×°Â·¾¶¿ÉÒÔÑ¡ÔñÈÎÒâ´ÅÅÌĿ¼£¬²»¹ý½¨ÒéÄã·ÅµÄĿ¼²ã´ ......
ÔÚAndroidµÄÓ¦ÓóÌÐò¿ª·¢ÖУ¬Í¨³£Ê¹ÓõÄÊÇJAVAÓïÑÔ£¬³ýÁËÐèÒªÊìϤJAVAÓïÑԵĻù´¡ÖªÊ¶Ö®Í⣬»¹ÐèÒªÁ˽âAndroidÌṩµÄÀ©Õ¹µÄJAVA¹¦ÄÜ¡£
ÔÚÒ»°ãµÄJAVAÓ¦ÓÃÖУ¬Èç¹ûÐèÓÃÒýÓûù´¡Àà¿â£¬Í¨³£ÐèҪʹÓÃÈçϵķ½Ê½£º
import
javax.swing.*;
ÒÔÉÏ´úÂë±íʾÁËÒýÓÃJAVAµÄGUI×é¼þSwing,javax.swing¼´JAVAÖеÄÒ»¸ö°ü¡£
androidÌṩһР......
1. ¸ÅÊö
±¾ÎÄÖ÷Òª°üÀ¨ÒÔϼ¸¸ö·½Ã棺±àÂë»ù±¾ÖªÊ¶£¬java£¬ÏµÍ³Èí¼þ£¬url£¬¹¤¾ßÈí¼þµÈ¡£
ÔÚÏÂÃæµÄÃèÊöÖУ¬½«ÒÔ"ÖÐÎÄ"Á½¸ö×ÖΪÀý£¬¾²é±í¿ÉÒÔÖªµÀÆäGB2312±àÂëÊÇ"d6d0 cec4"£¬Unicode±àÂëΪ"4e2d 6587"£¬UTF±àÂë¾ÍÊÇ"e4b8ad e69687"¡£×¢Ò⣬ÕâÁ½¸ö×ÖûÓÐiso8859-1±àÂ룬µ«¿ÉÒÔÓÃiso8859-1±àÂëÀ´"±íʾ"¡£  ......
GRASPģʽ:General Responsibility Assignment Software Patterns£ºÍ¨ÓÃÔðÈηÖÅäÈí¼þģʽ
ÀïÃæÖØÒªµÄ¸ÅÄîÊÇÔðÈΣ¬ÔðÈÎÊÇÀà¼äµÄÒ»ÖÖºÏÔ¼»òÊÇÒåÎñ£¬¿ÉÒÔϸ·ÖΪÁ½²¿·Ö£¬Óù«Ê½±íʾÈçÏ£º
ÔðÈÎ = ÖªµÀÔðÈÎ + ÐÐΪÔðÈΣ¨ÕâÀïÃæËƺõ´æÔÚ¸ÅÄîµÄÑ»·¶¨Ò壩
×¢£ºÓÃͨË׵Ļ°À´½²£¬ÔðÈξÍÊÇÒ»¸öÀàÖªµÀÒª×öʲô£¬²¢ÇÒÄܹ»×öʲô¡£
· ......
import java.io.*;
public class IoTest
{
public static void main(String[] args)
{
String s;
s=calculate();
System.out.println(s);
}
static String calculate()
{
StringBuffer sb=new StringBuffer("");
try{
FileReader re ......