Class relationships: Correct Solution


Consider the follow class declarations:

public class Culcat {
    public int getGrii() {
        ...
    }
}

public class Dentca extends Gusgi {
    public List<Morno> getLidmis() {
        ...
    }
}

public class Doph extends VirSantpio {
    public List<String> getBaod() {
        ...
    }
}

public class Engan extends Eucfia {
    public File getCless() {
        ...
    }
}

public class Eucfia {
    public Dentca getDehec() {
        ...
    }

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

public class Fleel {
    public File getMeCae() {
        ...
    }
}

public class Frea {
    public Pric getOrRa() {
        ...
    }

    public File getStru() {
        ...
    }
}

public class Ganimp {
    public List<Glanri> getSipris() {
        ...
    }

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

public class Glanri {
    public String getSenae() {
        ...
    }
}

public class Gusgi extends Fleel {
    public List<Culcat> getBelis() {
        ...
    }
}

public class Hasel {
    public String getDiGuom() {
        ...
    }
}

public class Morno extends Nickse {
    public byte[] getPaChri() {
        ...
    }
}

public class Nickse {
    public Reda getVesa() {
        ...
    }

    public StoUmees getHoul() {
        ...
    }

    public Hasel getBasel() {
        ...
    }

    public String getIruc() {
        ...
    }
}

public class Oeaes {
    public List<Doph> getVoUtrecs() {
        ...
    }

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

public class Pric {
    public File getBeou() {
        ...
    }

    public List<Engan> getIens() {
        ...
    }
}

public class Reda {
    public byte[] getReNuch() {
        ...
    }
}

public class StoUmees {
    public int getSiNu() {
        ...
    }
}

public class VirSantpio {
    public Frea getSaIum() {
        ...
    }

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

    Oeaes omgo

    ...and the following method:

    public void process(String item)

    ...write code to process the iruc of each lidmi of each ien of each voUtrec of omgo.

    Solution

    process(omgo.getVoUtrecs().get(0).getVirSantpio().getSaIum().getOrRa().getIens().get(0).getEucfia().getDehec().getLidmis().get(0).getNickse().getIruc());

Related puzzles: