heap and stack

c++

  1. heap:use new to apply,use delete to free
  2. stack:system allocate/free
    1)compiling: variable or function
    2)running:Parameter transfer

java

  1. heap:use new to apply,GC will free it with on reference
  2. stack:system allocate/free

c

  1. heap:use malloc to apply,use free to free
  2. stack:system allocate/free
    1)compiling: variable or function
    2)running:Parameter transfer