SE450: Overriding: Instance fields [19/35] |
Instance fields [source] [doc-public] [doc-private]
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
package subclass.ex6; public class M { public static void main(String[] argv) { (new B()).m(); } } class A { void p() { System.out.println("A.p: " + x); // which x? } final int x = 42; } class B extends A { void m() { this.p(); System.out.println("B.m: " + x); // which x? } final int x = 27; }