Class relationships: Correct Solution


Consider the follow class declarations:

public class Asast extends Iiomp {
    public File getAsMous() {
        ...
    }
}

public class Cirqe {
    public String getEgri() {
        ...
    }
}

public class Crorco extends Iosmec {
    public Vethon getDehe() {
        ...
    }
}

public class EkoChlid {
    public List<String> getSedos() {
        ...
    }

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

public class Fernent extends Vicis {
    public List<Vecor> getMoJipas() {
        ...
    }

    public List<EkoChlid> getBusas() {
        ...
    }
}

public class Iiomp {
    public List<Sesspsas> getZedius() {
        ...
    }

    public NicTulsunt getOuck() {
        ...
    }
}

public class Iosmec {
    public Fernent getIson() {
        ...
    }

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

public class Kanch extends Odpel {
    public List<Pebo> getPannis() {
        ...
    }
}

public class Lopin {
    public File getSaHa() {
        ...
    }
}

public class NicTulsunt {
    public String getOpKuc() {
        ...
    }
}

public class Odpel {
    public File getUlsiw() {
        ...
    }
}

public class Patdest {
    public byte[] getEcDi() {
        ...
    }
}

public class Pebo {
    public List<Lopin> getOsses() {
        ...
    }

    public List<Crorco> getWras() {
        ...
    }
}

public class Qaltri {
    public Asast getBicbo() {
        ...
    }

    public int getOntpo() {
        ...
    }
}

public class Sesspsas extends Silni {
    public Swir getOndec() {
        ...
    }

    public Patdest getAspid() {
        ...
    }
}

public class Silni {
    public int getJae() {
        ...
    }
}

public class Swir extends Kanch {
    public int getEnDaa() {
        ...
    }
}

public class Vecor {
    public String getCiPe() {
        ...
    }
}

public class Vethon {
    public int getPanu() {
        ...
    }

    public Cirqe getSmis() {
        ...
    }
}

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

    Qaltri wol

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the proac of each busa of each wra of the first panni of each zediu of wol.

    Solution

    for (Pebo panni : wol.getBicbo().getIiomp().getZedius().get(0).getOndec().getKanch().getPannisList()) {
        process(panni.getWras().get(0).getIosmec().getIson().getBusas().get(0).getProac());
    }

Related puzzles: