Class relationships: Correct Solution


Consider the follow class declarations:

public class Bliseos extends Zanred {
    public Ucree getRarel() {
        ...
    }
}

public class CilIri {
    public String getBric() {
        ...
    }
}

public class Deextea {
    public List<String> getAspus() {
        ...
    }
}

public class Fimnal {
    public List<String> getIleo() {
        ...
    }
}

public class Firzio {
    public File getMusoi() {
        ...
    }
}

public class Heac {
    public List<Bliseos> getIrmiws() {
        ...
    }

    public File getGoNau() {
        ...
    }
}

public class Iantos {
    public List<String> getDeUnid() {
        ...
    }

    public List<Phipio> getHesms() {
        ...
    }
}

public class Oanpe extends Slih {
    public List<Firzio> getWuacs() {
        ...
    }
}

public class OvoTroshi {
    public File getVauc() {
        ...
    }
}

public class Phipio {
    public byte[] getHosh() {
        ...
    }
}

public class Plaf {
    public File getBanno() {
        ...
    }
}

public class Scricce {
    public Sirk getFoc() {
        ...
    }

    public CilIri getReenu() {
        ...
    }
}

public class Shacthi extends Deextea {
    public Veaet getHori() {
        ...
    }
}

public class Sirk {
    public File getMiope() {
        ...
    }

    public File getEte() {
        ...
    }
}

public class Slih {
    public byte[] getVua() {
        ...
    }

    public List<Scricce> getLaSealts() {
        ...
    }
}

public class Spli {
    public Heac getIcec() {
        ...
    }

    public int getErar() {
        ...
    }
}

public class SwiCecar extends Plaf {
    public List<Spli> getXosos() {
        ...
    }
}

public class Ucree extends Fimnal {
    public List<Iantos> getSpoas() {
        ...
    }
}

public class Veaet extends SwiCecar {
    public OvoTroshi getHoud() {
        ...
    }
}

public class Zanred {
    public String getDood() {
        ...
    }

    public Oanpe getMaSwol() {
        ...
    }
}
  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:

    Shacthi jo

    ...and the following method:

    public void process(File item)

    ...write code to process the ete of the first laSealt of the first irmiw of each xoso of jo.

    Solution

    for (Bliseos irmiw : jo.getHori().getSwiCecar().getXosos().get(0).getIcec().getIrmiwsList()) {
        for (Scricce laSealt : irmiw.getZanred().getMaSwol().getSlih().getLaSealtsList()) {
            process(laSealt.getFoc().getEte());
        }
    }

Related puzzles: