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