Class relationships: Correct Solution


Consider the follow class declarations:

public class Dasit extends Gasad {
    public int getPrisa() {
        ...
    }
}

public class Gasad {
    public Slen getVothe() {
        ...
    }

    public int getLem() {
        ...
    }
}

public class Hiftid {
    public String getOnVu() {
        ...
    }
}

public class Slen {
    public File getRePeic() {
        ...
    }

    public List<Toargmus> getGias() {
        ...
    }
}

public class Sleoss {
    public File getArex() {
        ...
    }
}

public class Toargmus extends Hiftid {
    public List<Sleoss> getCeDuceds() {
        ...
    }

    public List<String> getIplo() {
        ...
    }
}
  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:

    Dasit smes

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the iplo of each gia of smes.

    Solution

    process(smes.getGasad().getVothe().getGias().get(0).getIplo());

Related puzzles: