1
2
3
4
5
6
7
8
9
10
11
12 package com.puppycrawl.tools.checkstyle.checks.descendanttoken;
13
14
15 class Example5 {
16 void testMethod1() {
17 for (int i = 0; i != 10; i++) {
18 System.out.println(i);
19 }
20 int k = 0;
21 for (; ; ) {
22 System.out.println(k);
23 }
24 }
25
26 void testMethod2() {
27 int[] array = new int[] {1, 2, 3, 4, 5};
28 for (int i = 0; i != array.length; i++) {
29 System.out.println(i);
30 }
31 int j = 0;
32
33 for (; j != array.length;) {
34 System.out.println(j);
35 j++;
36 }
37 }
38 }
39