Class relationships: Correct Solution


Consider the follow class declarations:

public class Arclo extends Plollus {
    public File getBreae() {
        ...
    }
}

public class CelMonpuft {
    public byte[] getSobe() {
        ...
    }

    public List<Trangic> getRoteps() {
        ...
    }
}

public class Chitce extends Iusbi {
    public byte[] getNoPa() {
        ...
    }

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

public class Erbas {
    public List<String> getGinec() {
        ...
    }
}

public class Islund {
    public int getDesac() {
        ...
    }

    public List<Arclo> getButhas() {
        ...
    }
}

public class Iusbi {
    public File getJionk() {
        ...
    }
}

public class MurSuesm {
    public List<Tial> getEnts() {
        ...
    }

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

public class Oproun {
    public List<String> getOsTeo() {
        ...
    }
}

public class Plollus {
    public int getGeu() {
        ...
    }

    public Chitce getBiher() {
        ...
    }
}

public class QolGira extends Shunird {
    public List<CelMonpuft> getNaCesks() {
        ...
    }
}

public class Renmid extends Erbas {
    public List<Sphishos> getPrants() {
        ...
    }
}

public class Shunird {
    public File getPrei() {
        ...
    }

    public Islund getSoEdti() {
        ...
    }
}

public class Sphishos extends QolGira {
    public MurSuesm getChim() {
        ...
    }
}

public class Tial {
    public Oproun getIwar() {
        ...
    }

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

public class Trangic {
    public File getNel() {
        ...
    }
}

public class Tuda {
    public File getAsm() {
        ...
    }

    public Renmid getTrobo() {
        ...
    }
}
  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:

    Tuda hese

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the pla of each butha of the first prant of hese.

    Solution

    for (Sphishos prant : hese.getTrobo().getPrantsList()) {
        process(prant.getQolGira().getShunird().getSoEdti().getButhas().get(0).getPlollus().getBiher().getPla());
    }

Related puzzles: