I am a beginner in java. I was trying this code where I created the instance of class in the class itself.
It was giving me stack overflow error. Then, I make the reference variable 'static' in the class and now it is working fine.
My question is what does static keyword do here? I know static variable are class variable which is loaded only once. But, should the constructor call also get into recursive call to itself? I am not able to get any answer from my knowledge about static keyword.