Class relationships: Correct Solution


Consider the follow class declarations:

public class Boisstoss extends Oeeint {
    public Nass getEiHur() {
        ...
    }
}

public class Cobel {
    public int getLorod() {
        ...
    }
}

public class Gephesm extends Lacssent {
    public List<Shiuliss> getCegads() {
        ...
    }

    public Boisstoss getMedra() {
        ...
    }
}

public class Gethroo {
    public String getRuBi() {
        ...
    }
}

public class Gicbro {
    public Tiss getEctu() {
        ...
    }

    public String getIcles() {
        ...
    }

    public String getTac() {
        ...
    }
}

public class Irtdong extends Kitour {
    public List<String> getImiss() {
        ...
    }
}

public class Kitour {
    public List<Pruc> getInCiungs() {
        ...
    }

    public Gethroo getCing() {
        ...
    }
}

public class Lacssent {
    public byte[] getSarma() {
        ...
    }
}

public class Lofpra extends Lolant {
    public Tritbung getEnOs() {
        ...
    }
}

public class Lolant {
    public File getSiChrar() {
        ...
    }
}

public class Mimeuc {
    public String getSohed() {
        ...
    }

    public Cobel getAcmat() {
        ...
    }
}

public class Minme {
    public List<Gicbro> getHiCas() {
        ...
    }

    public List<Mimeuc> getCeGles() {
        ...
    }
}

public class Nass extends Minme {
    public List<String> getNird() {
        ...
    }
}

public class Oeeint {
    public List<String> getFroun() {
        ...
    }
}

public class Pruc extends Gephesm {
    public List<String> getTant() {
        ...
    }
}

public class Shiuliss {
    public byte[] getBaNoss() {
        ...
    }
}

public class Tiss {
    public String getMaZas() {
        ...
    }
}

public class Tritbung {
    public List<Irtdong> getAhAses() {
        ...
    }

    public int getOdCi() {
        ...
    }
}
  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:

    Lofpra pe

    ...and the following method:

    public void process(String item)

    ...write code to process the tac of each hiCa of each inCiung of the first ahAs of pe.

    Solution

    for (Irtdong ahAs : pe.getEnOs().getAhAsesList()) {
        process(ahAs.getKitour().getInCiungs().get(0).getGephesm().getMedra().getEiHur().getMinme().getHiCas().get(0).getTac());
    }

Related puzzles: