Class relationships: Correct Solution


Consider the follow class declarations:

public class Anass {
    public String getPlin() {
        ...
    }
}

public class CeiBredo extends Siderk {
    public String getPuc() {
        ...
    }
}

public class Emsesm {
    public Lofcel getNeie() {
        ...
    }

    public int getXotpe() {
        ...
    }
}

public class Gath {
    public Sedpen getPsopi() {
        ...
    }

    public List<Nepu> getHaSis() {
        ...
    }
}

public class Hidsed extends Prol {
    public NenUnpe getPught() {
        ...
    }

    public List<Anass> getRodids() {
        ...
    }
}

public class IenScrucni {
    public String getBaIrpha() {
        ...
    }
}

public class Ionsal {
    public List<String> getSas() {
        ...
    }
}

public class IssTosir extends Emsesm {
    public CeiBredo getIthar() {
        ...
    }

    public IenScrucni getPri() {
        ...
    }
}

public class Konra extends Ussnont {
    public File getJoUd() {
        ...
    }
}

public class Lofcel {
    public String getCaras() {
        ...
    }

    public int getNec() {
        ...
    }
}

public class NenUnpe {
    public List<Gath> getIeds() {
        ...
    }

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

public class Nepu {
    public String getMiDocku() {
        ...
    }
}

public class Prol {
    public byte[] getNosm() {
        ...
    }
}

public class Sedpen extends IssTosir {
    public byte[] getEmIck() {
        ...
    }
}

public class Siderk {
    public List<String> getOpUrra() {
        ...
    }
}

public class Ussnont {
    public List<Ionsal> getVoirbs() {
        ...
    }

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

    Konra na

    ...and the following method:

    public void process(int item)

    ...write code to process the nec of the first ied of each olorm of na.

    Solution

    for (Gath ied : na.getUssnont().getOlorms().get(0).getPught().getIedsList()) {
        process(ied.getPsopi().getIssTosir().getEmsesm().getNeie().getNec());
    }

Related puzzles: