Popular posts from this blog
Memory Management In Java – Stack And Heap
Whenever you trigger a java command, it divides allocated memory into two parts – Stack and Heap. Stack is used only for execution purpose. Heap is used for storage purpose. consider the following program and we will see how it uses stack and heap memory through diagram. ? class StackAndHeapMemory { static void methodOne() { System.out.println("From Method One"); methodTwo(); } static void methodTwo() { System.out.println("From Method Two"); } public static void main(String[] args) { System.out.println("Main Method Started"); methodOne(); System.out.println("Main Method Ended"); } ...

Comments
Post a Comment