Class relationships: Correct Solution


Consider the follow class declarations:

public class Blilod {
    public List<String> getOngte() {
        ...
    }
}

public class Dasmmuas {
    public byte[] getIbre() {
        ...
    }
}

public class EntSpighgra {
    public String getAhis() {
        ...
    }
}

public class Fior extends Husdram {
    public Kalftung getIss() {
        ...
    }
}

public class Husdram {
    public String getSirer() {
        ...
    }
}

public class Kalftung {
    public List<Thanthiss> getDiDes() {
        ...
    }

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

public class Lumesm {
    public byte[] getSucor() {
        ...
    }

    public List<Dasmmuas> getTewns() {
        ...
    }
}

public class Menent {
    public List<Rilhec> getHiags() {
        ...
    }

    public int getZeColal() {
        ...
    }
}

public class Nouscral {
    public List<Lumesm> getElTrers() {
        ...
    }

    public Blilod getEcSto() {
        ...
    }

    public Slihor getArCes() {
        ...
    }
}

public class Piwhass {
    public File getSaRo() {
        ...
    }
}

public class Prien extends Menent {
    public Sqad getBuWesi() {
        ...
    }
}

public class Prirl extends Fior {
    public String getKeGrono() {
        ...
    }
}

public class Rilhec extends Piwhass {
    public Prirl getIalto() {
        ...
    }
}

public class Slihor {
    public List<String> getCoScroc() {
        ...
    }

    public File getEnEs() {
        ...
    }
}

public class Sqad {
    public File getOcPnar() {
        ...
    }
}

public class Thanthiss extends EntSpighgra {
    public List<Nouscral> getPhasts() {
        ...
    }
}
  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:

    Prien su

    ...and the following method:

    public void process(File item)

    ...write code to process the enEs of each phast of each diDe of each hiag of su.

    Solution

    process(su.getMenent().getHiags().get(0).getIalto().getFior().getIss().getDiDes().get(0).getPhasts().get(0).getArCes().getEnEs());

Related puzzles: