I want an example where stacks are used in java application development ??
Basically stack consists of two compartments...one for local variables and other fr the method...so once the method is executed that area in stack is popped off and the variable values are also cleared..so wen the method is called again,stack allocation happens again.
Method level variables live in stack.. Instance level variables live in heap.. Any method call can be talked of as an implementation of stack concept
Whatever reference variable u r going to create those will store in stack only not in heap memory. N our local variable also store in stack while executing program.
Make a game of snake