This is a snippet of Java code:
static {
ture = 9;
}
static int ture;
{ // instance block
System.out.println(\":\"+ture+\":\");
As others have said, the place of declaration is generally inconsequential.
But sometimes it may cause confusions:
class Z {
static int i = j + 2; // what should be the value of j here?
static int j = 4;
}
So Java does add some restrictions on forward reference: http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.3.2.3
Your example is allowed because the usage of the field is on the left hand side of an assignment. Apparently the language designers don't think it's too confusing. Nevertheless we should probably always avoid forward reference if we can.