Наследование Java - это ключевое слово

Я искал в Интернете похожий вопрос, но не смог его найти. Итак, размещение здесь.

В следующей программе, почему значение «я» печатается как 100?

НАСКОЛЬКО МНЕ ИЗВЕСТНО 'этот' ссылается на текущий объект; который в этом случаеTestChild» и имя класса также правильно напечатано. Но почему значение переменной экземпляра не равно 200?

public class TestParentChild {
    public static void main(String[] args) {
        new TestChild().printName();
    }
}

class TestChild extends TestParent{
    public int i = 200;
}

class TestParent{
    public int i = 100;
    public void printName(){
        System.err.println(this.getClass().getName());
        System.err.println(this.i); //Shouldn't this print 200
    }
}

И более того, результат следующий, как я ожидал. Метод дочернего класса вызывается, когда я вызываюэтот тест()" из родительского класса.

public class TestParentChild {
    public static void main(String[] args) {
        new TestChild().printName();
    }
}

class TestChild extends TestParent{
    public int i = 200;
    public void test(){
        System.err.println("Child Class : "+i);
    }

}

class TestParent{
    public int i = 100;
    public void printName(){
        System.err.println(this.getClass().getName());
        System.err.println(this.i); //Shouldn't this print 200
        this.test();
    }
    public void test(){
        System.err.println("Parent Class : "+i);
    }
}

Ответы на вопрос(3)

Ваш ответ на вопрос