Hi, I would like to know how Java stores and handles static variables internally.
I believe they are stored on the stack, but what happens if the memory limit is exceeded?
Also, does Java keep recycling the storage by an algorithm like Least Recently Used(LRU) or it simply gives a Stack Overflow error if the memory limit is exceeded?
what u r saying is exactly correct. In java static vaiables are stored in the stack because it is very fast to acess. It internally follows the LRU algorithm.