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