Question: I am using java and I would like to force all of my subclasses to use the variables of the superclass.
The superclass is abstract and the subclasses implement all of its methods but not the variables.
Is there any way I can force the subclasses to use also the variables of the superclass?

thanks

Answer: 
The keyword `super` is most of the times used in conjunction to accessing superclass methods, most of the times a constructor from the parent class .

However, you can also use `super` to access fields of the superclass.

Here is an example of the usage for accessing fields.

```
public class Base {

    public int a = 1;
    protected int b = 2;
    private int c = 3;

    public Base(){

    }
}

public class Extended extends Base{

    public int a = 4;
    protected int b = 5;
    private int c = 6;

    public Extended(){

    }

    public void print(){
        //Fields from the superclass
        System.out.println(super.a);
        System.out.println(super.b);
        System.out.println(super.c); // not possible

    }
}

public static void main(String[] args) {
        Extended ext = new Extended();
        ext.print();
    }

```

You can always rename the fields in your subclasses not to conflict, but if you want to distinguish a method parameter or local variable from the superclass field, use `super` as you would use `this`
Simple. All you need is to let the subclass inherit the superclass through inheritance. this would allow your subclass implement functions of your superclass. 

For a more detailed reference kindly visit this link: <http://docstore.mik.ua/orelly/java-ent/jnut/ch03_04.htm>