So I was looking at this question here. And people were suggesting that you can put code in a java class like so
class myClass
{
int a;
{
//insert code here dealing with a
}
}
How does the code in the brackets get executed and when does it get executed? Is there any limit to what I can put there or is it just reserved for variable initialization?
Thanks!
the constructor is translated to