Create Stack vs Heap memory in Java