1 /*xml 2 <module name="Checker"> 3 <module name="TreeWalker"> 4 <module name="DeclarationOrder"> 5 <property name="ignoreConstructors" value="true"/> 6 </module> 7 </module> 8 </module> 9 */ 10 11 package com.puppycrawl.tools.checkstyle.checks.coding.declarationorder; 12 13 // xdoc section -- start 14 public class Example2 { 15 16 public int a; 17 protected int b; 18 public int c; // violation, variable access definition in wrong order 19 20 Example2() { 21 this.a = 0; 22 } 23 24 public void foo() { 25 // This method does nothing 26 } 27 28 Example2(int a) { // OK, validation of constructors ignored 29 this.a = a; 30 } 31 32 private String name; // violation, instance variable declaration in wrong order 33 } 34 // xdoc section -- end