Class relationships: Correct Solution


Consider the follow class declarations:

public class Castsur extends Ival {
    public byte[] getHiirm() {
        ...
    }
}

public class Chreneou {
    public byte[] getOdIrir() {
        ...
    }

    public Trea getSiDusod() {
        ...
    }
}

public class Engci {
    public File getBla() {
        ...
    }

    public Castsur getIun() {
        ...
    }
}

public class Gesh {
    public File getFras() {
        ...
    }
}

public class Ival {
    public int getBloss() {
        ...
    }

    public File getPeGe() {
        ...
    }
}

public class Nera {
    public List<Swio> getLelks() {
        ...
    }

    public Scendal getIrPhica() {
        ...
    }
}

public class Norch {
    public int getVing() {
        ...
    }
}

public class Pepra extends Chreneou {
    public Norch getDaEnt() {
        ...
    }

    public List<Nera> getPuis() {
        ...
    }

    public List<Gesh> getUsmis() {
        ...
    }
}

public class Scendal extends Vorback {
    public String getOdo() {
        ...
    }
}

public class Swio {
    public int getWiNua() {
        ...
    }
}

public class Trea {
    public byte[] getHess() {
        ...
    }
}

public class Vorback {
    public List<Engci> getHioans() {
        ...
    }

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

    Pepra cah

    ...and the following method:

    public void process(File item)

    ...write code to process the peGe of each hioan of each pui of cah.

    Solution

    process(cah.getPuis().get(0).getIrPhica().getVorback().getHioans().get(0).getIun().getIval().getPeGe());

Related puzzles: