Class relationships: Correct Solution


Consider the follow class declarations:

public class Assic {
    public int getEenpe() {
        ...
    }

    public String getDasas() {
        ...
    }
}

public class Dehguan {
    public byte[] getEho() {
        ...
    }
}

public class EouOsla {
    public List<Lusnent> getPoungs() {
        ...
    }

    public List<Twienveur> getIaphas() {
        ...
    }
}

public class Esta {
    public String getHiDoda() {
        ...
    }

    public SioMispa getFlele() {
        ...
    }
}

public class Lusnent extends Esta {
    public File getReUsill() {
        ...
    }
}

public class Michist {
    public File getHos() {
        ...
    }
}

public class Muja extends NioBifpric {
    public List<Oacvo> getHios() {
        ...
    }
}

public class NioBifpric {
    public int getOhSu() {
        ...
    }
}

public class Oacvo extends Assic {
    public List<Michist> getIops() {
        ...
    }
}

public class SioMispa {
    public Stooia getEnUe() {
        ...
    }

    public Muja getIas() {
        ...
    }
}

public class Stooia {
    public int getDiTioss() {
        ...
    }
}

public class Twienveur {
    public String getTroc() {
        ...
    }

    public Dehguan getErch() {
        ...
    }
}
  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:

    EouOsla to

    ...and the following method:

    public void process(String item)

    ...write code to process the dasas of each hio of each poung of to.

    Solution

    process(to.getPoungs().get(0).getEsta().getFlele().getIas().getHios().get(0).getAssic().getDasas());

Related puzzles: