Class relationships: Correct Solution


Consider the follow class declarations:

public class Arva {
    public Psode getThid() {
        ...
    }

    public String getCusli() {
        ...
    }
}

public class Bril {
    public List<Sebpib> getEmAdus() {
        ...
    }

    public File getIrfo() {
        ...
    }
}

public class Cocstia {
    public String getUrVior() {
        ...
    }
}

public class Cufet {
    public Ress getFierk() {
        ...
    }

    public Fepo getOchco() {
        ...
    }

    public Bril getEheax() {
        ...
    }
}

public class Dongoff extends Cufet {
    public List<Urtuc> getFoOtafts() {
        ...
    }
}

public class Fepo {
    public byte[] getFeol() {
        ...
    }
}

public class Gempro {
    public int getCifis() {
        ...
    }
}

public class Hosssas extends Oest {
    public List<Cocstia> getIbes() {
        ...
    }
}

public class Isten {
    public List<String> getIcel() {
        ...
    }
}

public class Nalan extends Onthcrai {
    public List<VomUss> getUnrus() {
        ...
    }
}

public class Oest {
    public List<String> getCrepa() {
        ...
    }

    public byte[] getSerso() {
        ...
    }
}

public class Onthcrai {
    public File getDiVebra() {
        ...
    }

    public List<Phioki> getIocs() {
        ...
    }
}

public class Phioki {
    public List<String> getHoNasm() {
        ...
    }
}

public class Psode {
    public byte[] getTeIlti() {
        ...
    }
}

public class Pucvia {
    public List<Gempro> getAtRuesses() {
        ...
    }

    public List<Hosssas> getHaacs() {
        ...
    }
}

public class Relcoud extends Isten {
    public Nalan getOsAeou() {
        ...
    }
}

public class Ress {
    public File getPaWi() {
        ...
    }
}

public class Sebpib {
    public Pucvia getWhast() {
        ...
    }

    public Tilto getOoDra() {
        ...
    }

    public List<Arva> getSuOlths() {
        ...
    }
}

public class Socis {
    public File getCesma() {
        ...
    }

    public List<Relcoud> getRocins() {
        ...
    }
}

public class Sqontto extends Socis {
    public byte[] getElLo() {
        ...
    }
}

public class Tilto {
    public int getSiril() {
        ...
    }
}

public class Tiwren {
    public int getCopi() {
        ...
    }

    public Sqontto getGiEs() {
        ...
    }
}

public class Urtuc {
    public int getFupan() {
        ...
    }
}

public class VomUss extends Dongoff {
    public String getKihar() {
        ...
    }
}
  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:

    Tiwren de

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the serso of each haac of each emAdu of each unru of each rocin of de.

    Solution

    process(de.getGiEs().getSocis().getRocins().get(0).getOsAeou().getUnrus().get(0).getDongoff().getCufet().getEheax().getEmAdus().get(0).getWhast().getHaacs().get(0).getOest().getSerso());

Related puzzles: