1 // PR19870: Test static field access across nested class boundaries. 2 // 3 public class PR19870 4 { 5 private static int x = 123; 6 7 static class Foo 8 { 9 private static int junk = 1000; 10 snafu( )11 static void snafu( ) 12 { 13 System.out.println( x); 14 x = 456; 15 System.out.println( PR19870.x); 16 PR19870.x = 789; 17 System.out.println( PR19870.x); 18 19 System.out.println( Bar.junk); 20 } 21 } 22 23 static class Bar 24 { 25 private static int junk = 1984; 26 snafu( )27 static void snafu( ) 28 { 29 System.out.println( Foo.junk); 30 Foo.junk = 2000; 31 System.out.println( Foo.junk); 32 } 33 } 34 main( String[] args)35 public static void main( String[] args) 36 { 37 Foo.snafu( ); 38 Bar.snafu( ); 39 40 System.out.println( Foo.junk); 41 Foo.junk = 3000; 42 System.out.println( Foo.junk); 43 } 44 } 45