
Relation Between Static Keyword and Memory Allocation
In Java, static keyword usage on variables means that memory is allocated and it will not be possible for the garbage collector to reclaim the memory until the application terminates. To be clear, do not use static keyword for variables that are local (used within a scope). Use static only