public static class DomesticAnimal {
    private int weight;
    private int age;

    public int getWeight() {
        return this.weight;

public static class Chicken extends DomesticAnimal {
    public int wings;

    public void setWeight() {
        this.weight = 5; // error! weight has private access in DomesticAnimal
Class "Chicken" inherits the variables from the class Domestic Animal. I would think it means the Chicken class (and its object) has the own "private weight" variable. This variable is inherited, so this should exist in a Chicken-object, too. But in the Chicken class i can't access my own weight variable. Or is it not completely my own variable here, = not inherited 100% completely, is it only some type of borrow? With more narrow rights. (Yes, i know, move the setWeight() method into the parent-class, and it will work. But my question is not this here.) Thanks!:)