1. package test1;
2. public class Test1 {
3. static int x = 42;
4. }
1. package test2;
2. public class Test2 extends test1.Test1 {
3. public static void main(String[] args) {
4. System.out.println("x = " + x);
5. }
6. }
Compilation fails because of an error in line 2 of class Test2.
or
Compilation fails because of an error in line 4 of class Test2.
regards
Rex
2. public class Test1 {
3. static int x = 42;
4. }
1. package test2;
2. public class Test2 extends test1.Test1 {
3. public static void main(String[] args) {
4. System.out.println("x = " + x);
5. }
6. }
Compilation fails because of an error in line 2 of class Test2.
or
Compilation fails because of an error in line 4 of class Test2.
regards
Rex