Traditional Practice to initialize the field members of a class
<p>I come from C++ background, where the field of a class are initialized inside the constructor. But here is java I see that I can initialize then while declaring, which is different from C++.</p>

<p>So, I my question was which is the best/traditional practice to initialize the field members of any class. Is it...</p>

<ul>
<li><p>at the time to declaring?</p>

<p>class testClass
{
private int x = 100;
}</p></li>
<li><p>using non-static scope? </p>

<p>class testClass{
private int x;
{
x = 100;
}
}</p></li>
<li><p>or inside of a constructor?</p>

<p>class testClass{
private int x;
testClass(){x = 100;}
}</p></li>
</ul>

<p>( Because I of my background I am a little biased towards initializing field members inside of a constructor.)</p>
