Class relationships: Correct Solution


Consider the follow class declarations:

public class Amith {
    public String getLic() {
        ...
    }

    public Uaha getNir() {
        ...
    }
}

public class Chredal {
    public List<String> getAaDe() {
        ...
    }

    public List<Enfioun> getElNels() {
        ...
    }
}

public class CinClissdrer {
    public String getUstwe() {
        ...
    }
}

public class Dacblesh extends Shong {
    public File getBila() {
        ...
    }
}

public class Danguh {
    public int getErEcan() {
        ...
    }
}

public class Enfioun {
    public List<String> getImEab() {
        ...
    }
}

public class FulPemwel {
    public int getLiEasi() {
        ...
    }
}

public class OomTre extends Papza {
    public byte[] getCaad() {
        ...
    }
}

public class Oopi {
    public byte[] getNiafa() {
        ...
    }
}

public class Papza {
    public List<Sclouncon> getResaus() {
        ...
    }

    public FulPemwel getEcIna() {
        ...
    }

    public List<Dacblesh> getPenpes() {
        ...
    }
}

public class Plego {
    public File getEped() {
        ...
    }

    public List<Sclon> getPretis() {
        ...
    }
}

public class PseRela extends OomTre {
    public CinClissdrer getSpo() {
        ...
    }
}

public class Reil {
    public List<Oopi> getPucs() {
        ...
    }

    public Whicfuc getSibec() {
        ...
    }
}

public class Sclon {
    public List<String> getTiSihie() {
        ...
    }

    public Chredal getTral() {
        ...
    }

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

public class Sclouncon {
    public Amith getIdear() {
        ...
    }

    public int getInLale() {
        ...
    }
}

public class Shong {
    public int getPeEssid() {
        ...
    }
}

public class Uaha extends Plego {
    public int getWiai() {
        ...
    }
}

public class Whicfuc extends Danguh {
    public List<PseRela> getIges() {
        ...
    }
}
  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:

    Reil riad

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the cer of the first preti of each resau of each ige of riad.

    Solution

    for (Sclon preti : riad.getSibec().getIges().get(0).getOomTre().getPapza().getResaus().get(0).getIdear().getNir().getPlego().getPretisList()) {
        process(preti.getCer());
    }

Related puzzles: