1
2
3
4
5
6
7
8
9
10 package com.puppycrawl.tools.checkstyle.checks.coding.variabledeclarationusagedistance;
11
12
13 public class Example2 {
14
15 public void foo1() {
16 int num;
17 final double PI;
18 System.out.println("Statement 1");
19 System.out.println("Statement 2");
20 System.out.println("Statement 3");
21 num = 1;
22 PI = 3.14;
23 }
24
25 public void foo2() {
26 int a;
27 int b;
28 int count = 0;
29
30 {
31 System.out.println("Inside inner scope");
32 a = 1;
33 b = 2;
34 count++;
35 }
36 }
37 }
38