<p>
According to the Java Code Conventions as defined by Oracle, the parts of a class or interface declaration should appear in the following order in the source files:
<ul>
<li>Class and instance variables</li>
<li>Constructors</li>
<li>Methods</li>
</ul>
</p>

<h2>Noncompliant Code Example</h2>
<pre>
public class Foo {
  private int field = 0;
  isTrue() {...}
  public Foo() {...}                // Noncompliant, constructor defined after method
  public static final int OPEN = 4; // Noncompliant, variable defined after method
}
</pre>

<h2>Compliant Solution</h2>
<pre>
public class Foo{  // Compliant
  public static final int OPEN = 4;
  private int field = 0;
  public Foo() {...}
  public boolean isTrue() {...}
}
</pre>