1. Overriding concept is not applicable for variables and it is applicable only for methods.
  2. Variable resolution always takes care by compiler based on reference type.
public class OverridingDemo {
 
    public static void main(String[] args) {
         
        Parent parent=new Parent();
        System.out.println(parent.i);
        Parent parent1=new Child();
        System.out.println(parent1.i);
        Child child=new Child();
        System.out.println(child.i);
    }
}
 
class Parent{
     
    int i=1000;
     
}
class Child extends Parent{
    int i=2000;
}
/*
Output:
1000
1000
2000
*/