Class relationships: Correct Solution


Consider the follow class declarations:

public class Coroc {
    public File getElCece() {
        ...
    }
}

public class Daeck {
    public byte[] getUaPiouc() {
        ...
    }

    public List<Pade> getRasses() {
        ...
    }
}

public class Diocet extends Coroc {
    public Hiphel getIaea() {
        ...
    }
}

public class Hiphel {
    public byte[] getHedpu() {
        ...
    }
}

public class IdiLesmde extends Neasmting {
    public List<Diocet> getNeFungs() {
        ...
    }

    public Sqadi getHouli() {
        ...
    }
}

public class Iosm {
    public Weocstro getIiss() {
        ...
    }

    public List<Prahic> getOnSes() {
        ...
    }
}

public class LosSendo {
    public int getDecic() {
        ...
    }

    public String getSerda() {
        ...
    }
}

public class Neasmting {
    public File getCaEsti() {
        ...
    }
}

public class Pade extends IdiLesmde {
    public File getAlaf() {
        ...
    }
}

public class Pebon {
    public List<String> getRaLio() {
        ...
    }
}

public class Prahic {
    public byte[] getAtZo() {
        ...
    }

    public Tiassul getItShaan() {
        ...
    }
}

public class Sqadi extends Iosm {
    public List<Pebon> getTulocs() {
        ...
    }
}

public class Tiassul {
    public int getPaCil() {
        ...
    }

    public LosSendo getIpa() {
        ...
    }
}

public class Weocstro {
    public List<String> getIss() {
        ...
    }
}
  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:

    Daeck qe

    ...and the following method:

    public void process(String item)

    ...write code to process the serda of the first onSe of the first rass of qe.

    Solution

    for (Pade rass : qe.getRassesList()) {
        for (Prahic onSe : rass.getIdiLesmde().getHouli().getIosm().getOnSesList()) {
            process(onSe.getItShaan().getIpa().getSerda());
        }
    }

Related puzzles: