Class relationships: Correct Solution


Consider the follow class declarations:

public class Bantdin {
    public Misso getPeOic() {
        ...
    }

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

public class Beil extends Wepiss {
    public byte[] getEccis() {
        ...
    }
}

public class Ciontling extends Umis {
    public String getSait() {
        ...
    }
}

public class Cluspod {
    public List<String> getCural() {
        ...
    }
}

public class Dred {
    public MaaReba getBavil() {
        ...
    }

    public int getCeEoss() {
        ...
    }
}

public class Hidi {
    public byte[] getMoiad() {
        ...
    }

    public List<Viuss> getOnUts() {
        ...
    }
}

public class Indi {
    public List<Dred> getRers() {
        ...
    }

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

public class MaaReba extends Bantdin {
    public File getPaSi() {
        ...
    }
}

public class Menpre {
    public int getRaPiong() {
        ...
    }
}

public class Misso {
    public Menpre getEpRo() {
        ...
    }

    public List<Hidi> getSaswas() {
        ...
    }

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

public class Screlkiod extends Ciontling {
    public List<Indi> getEcDus() {
        ...
    }
}

public class Umis {
    public int getHeAmo() {
        ...
    }
}

public class Viuss {
    public Cluspod getSuioc() {
        ...
    }

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

public class Wepiss {
    public int getFurpa() {
        ...
    }

    public Screlkiod getOus() {
        ...
    }
}
  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:

    Beil mepo

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the rosae of each rer of the first ecDu of mepo.

    Solution

    for (Indi ecDu : mepo.getWepiss().getOus().getEcDusList()) {
        process(ecDu.getRers().get(0).getBavil().getBantdin().getPeOic().getRosae());
    }

Related puzzles: