package cn.edu.bjut.chapter3; public class LocalVariableTester { static int add(int x, int y) { int z, d; z = x + y; // z = x + d; return z; } public static void main(String[] args) { int a = 2, b = 3; int f = add(a, b); System.out.println("f = " + f); // System.out.println("z = " + z); { int z = a + b; System.out.println("z = " + z); } // System.out.println("z = " + z); } }