class Process {
byte b=127;
Process() {
this.methodA();
}
void methodA() {
System.out.println("Value of Super b is = " + b );
}
public static void main(
String [] args) {
Processor p = new Processor();
}
}
class Processor extends Process {
byte b=126;
Processor() {
System.out.println("Value of b = " + b);
}
void methodA() {
System.out.println("Value of Sub b = " + b);
}
}
The output after run is:
Value of Sub b = 0
Value of b = 126
Why seems methodA of Processor is invoked while b of Processor is not initialized?