Class relationships: Correct Solution


Consider the follow class declarations:

public class Bissgia extends Chulder {
    public List<Waheng> getUims() {
        ...
    }
}

public class Chulder {
    public int getOuss() {
        ...
    }

    public List<Piag> getEsBes() {
        ...
    }
}

public class EntIpe {
    public Talti getRiusm() {
        ...
    }

    public List<Ialpen> getPnas() {
        ...
    }
}

public class Hedcoun {
    public byte[] getSemac() {
        ...
    }
}

public class Hicast {
    public byte[] getBorou() {
        ...
    }

    public List<EntIpe> getRers() {
        ...
    }
}

public class Ialpen {
    public byte[] getDosh() {
        ...
    }
}

public class Pesi {
    public byte[] getMispi() {
        ...
    }
}

public class Piag extends Pesi {
    public Hicast getCism() {
        ...
    }
}

public class Talti {
    public Hedcoun getElsce() {
        ...
    }

    public int getBrosm() {
        ...
    }

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

public class Waheng {
    public File getHeass() {
        ...
    }
}
  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:

    Bissgia osam

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the poBopep of the first rer of the first esBe of osam.

    Solution

    for (Piag esBe : osam.getChulder().getEsBesList()) {
        for (EntIpe rer : esBe.getCism().getRersList()) {
            process(rer.getRiusm().getPoBopep());
        }
    }

Related puzzles: