Class relationships: Correct Solution


Consider the follow class declarations:

public class Assel extends Mucsooc {
    public List<Cenbe> getCilas() {
        ...
    }
}

public class Asstos {
    public List<Socairth> getEnMes() {
        ...
    }

    public File getGeStess() {
        ...
    }
}

public class Bieso extends Asstos {
    public byte[] getRuang() {
        ...
    }
}

public class Brerstil {
    public List<String> getMoTalch() {
        ...
    }
}

public class Cenbe {
    public File getPran() {
        ...
    }

    public Rokir getMaSu() {
        ...
    }
}

public class CicHiostper {
    public byte[] getMiin() {
        ...
    }
}

public class Elboc {
    public byte[] getObun() {
        ...
    }
}

public class Fioshga extends Elboc {
    public Oingpit getHeEntde() {
        ...
    }

    public String getAncir() {
        ...
    }
}

public class HarPeshmo {
    public int getCoAc() {
        ...
    }
}

public class Ionttor extends Orsco {
    public List<Brerstil> getPsals() {
        ...
    }
}

public class Loced {
    public String getBeIs() {
        ...
    }
}

public class Mucsooc {
    public Ouhess getSiProgh() {
        ...
    }

    public String getPuIcmos() {
        ...
    }
}

public class Oingpit {
    public HarPeshmo getKepse() {
        ...
    }

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

public class Orsco {
    public int getFaEswoi() {
        ...
    }

    public Wioror getZouc() {
        ...
    }
}

public class Ouhess {
    public List<Bieso> getWals() {
        ...
    }

    public int getVir() {
        ...
    }
}

public class Rokir extends CicHiostper {
    public File getRuAr() {
        ...
    }
}

public class Socairth {
    public String getDiar() {
        ...
    }

    public Ionttor getIki() {
        ...
    }
}

public class Wioror {
    public List<Fioshga> getFetses() {
        ...
    }

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

    Assel uu

    ...and the following method:

    public void process(String item)

    ...write code to process the ancir of each fetse of the first enMe of the first wal of uu.

    Solution

    for (Bieso wal : uu.getMucsooc().getSiProgh().getWalsList()) {
        for (Socairth enMe : wal.getAsstos().getEnMesList()) {
            process(enMe.getIki().getOrsco().getZouc().getFetses().get(0).getAncir());
        }
    }

Related puzzles: