class ExampleInstanceVariable {
    public static void main(String[] arg) {
        Foo f1 = new Foo();  f1.foo = 10;
        Bar b2 = new Bar();  b2.foo = 20;  b2.bar = 21;
        Bar b3 = new Bar();  b3.foo = 30;  b3.bar = 31;
        System.out.print("f1.fooM():");  f1.fooM();
        System.out.print("b2.barM():");  b2.barM();
        System.out.print("b3.barM():");  b3.barM();
    }
}
class Foo {
    int foo;
    void fooM() {
        System.out.println(" foo=" + foo);
    }
}
class Bar extends Foo {
    int bar;
    void barM() {
        System.out.println(" foo=" + foo +", bar=" + bar);
    }
}

