Pushing variables to Stack and Variables living in the Stack difference?
问题 So I know that there exists 2 memory areas: Stack and Heap . I also know that if you create a local variable it will live in the Stack, not in the heap. Stack will grow as we push data into it as in: Now I will try to pass the confusion I am having to you: For example this simple Java Code: public class TestClass { public static void main(String[] args) { Object foo = null; Object bar = null; } } is translated into this byte code: public static void main(java.lang.String[]); Code: Stack=1,