Class relationships: Correct Solution


Consider the follow class declarations:

public class Ausssal {
    public File getMic() {
        ...
    }
}

public class Bresmasm extends Cang {
    public Nodner getOsbax() {
        ...
    }
}

public class Cang {
    public List<Ceth> getLospas() {
        ...
    }

    public int getArell() {
        ...
    }
}

public class Ceth {
    public int getUlcoc() {
        ...
    }

    public List<String> getLuos() {
        ...
    }
}

public class Essto {
    public File getEsh() {
        ...
    }
}

public class Gnedad {
    public List<String> getKaSo() {
        ...
    }
}

public class Nodner {
    public File getCier() {
        ...
    }
}

public class Priunti extends Gnedad {
    public List<Essto> getOnMelids() {
        ...
    }

    public List<Bresmasm> getHaCins() {
        ...
    }
}

public class Snorge {
    public Thinsoc getCiSiopi() {
        ...
    }

    public List<String> getSqin() {
        ...
    }
}

public class Thinsoc extends Priunti {
    public Ausssal getHeDroct() {
        ...
    }
}
  1. Draw a diagram showing the class relationships.

    You only need to diagram the classes listed above. You only need to show the name of each class; do not show their methods or properties.

    Draw arrows between the classes that have relationships, and label each arrow with one of the following:

    Make sure your arrows point in the correct direction!

    Solution

  2. Given the following variable:

    Snorge hi

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the luos of each lospa of each haCin of hi.

    Solution

    process(hi.getCiSiopi().getPriunti().getHaCins().get(0).getCang().getLospas().get(0).getLuos());

Related puzzles: