java memory analysis Sample 1

java memory analysis:

In general :( Technology Co., for reference)

final String  F = "hahah"; String  str =   "hahah"; static String st = "hshah";

① constant, literal, static literals are stored in the method area

Person  p = new Person("zhang",16);   int[]  a = new int[3];

② reference type variable references in the stack variables, open space in the heap

 

 

 

 

--- - - - ---- ---- --- - - - --- - --- ---- - - - Screenshot a cow off the net to see the respondents answer @ colala

Guess you like

Origin www.cnblogs.com/romulus/p/11111072.html
Recommended