public class variables1 { static int x = 1; // Global variable = class variable // (Only 1 copy of this variable) static void f( ) { int y = 4; // Local variable System.out.printf("x = %d, y = %d\n", x, y ); } public static void main(String[] argv) { int z = 2; // Local variable System.out.printf("x = %d, z = %d\n", x, z ); x = 777; // Update the class (~= global) variable f( ); } }