Class relationships: Correct Solution


Consider the follow class declarations:

public class DusAcht extends IorDulhi {
    public Ejess getBron() {
        ...
    }
}

public class Ejess {
    public Ishi getMuac() {
        ...
    }

    public int getOnpre() {
        ...
    }
}

public class Gecbar {
    public List<Stril> getAnmas() {
        ...
    }

    public NoiCadjel getEiTrene() {
        ...
    }
}

public class Goist {
    public Gecbar getDiOlgri() {
        ...
    }

    public List<Mour> getLePhroses() {
        ...
    }
}

public class Inoul {
    public File getOan() {
        ...
    }

    public List<Goist> getAdVis() {
        ...
    }
}

public class IorDulhi {
    public File getLucke() {
        ...
    }
}

public class Ishi extends Inoul {
    public int getUnElpre() {
        ...
    }
}

public class Mour {
    public Pirle getBlass() {
        ...
    }

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

public class NoiCadjel {
    public File getNiss() {
        ...
    }
}

public class Pirle {
    public File getEsEvo() {
        ...
    }

    public String getCiPuie() {
        ...
    }
}

public class Rint {
    public File getCron() {
        ...
    }

    public List<Tendiss> getRhosses() {
        ...
    }
}

public class Stiod {
    public File getNanpa() {
        ...
    }
}

public class Stril {
    public int getEglin() {
        ...
    }

    public Rint getPuch() {
        ...
    }
}

public class Tendiss {
    public String getThes() {
        ...
    }
}

public class Unis {
    public List<DusAcht> getBadus() {
        ...
    }

    public File getTemme() {
        ...
    }
}

public class Wirmel extends Unis {
    public List<Stiod> getCudris() {
        ...
    }
}
  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:

    Wirmel hess

    ...and the following method:

    public void process(String item)

    ...write code to process the ciPuie of each lePhros of each adVi of each badu of hess.

    Solution

    process(hess.getUnis().getBadus().get(0).getBron().getMuac().getInoul().getAdVis().get(0).getLePhroses().get(0).getBlass().getCiPuie());

Related puzzles: