Class relationships: Correct Solution


Consider the follow class declarations:

public class Audpau {
    public byte[] getSeTrax() {
        ...
    }
}

public class Caend {
    public Whil getUiqi() {
        ...
    }

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

    public File getEin() {
        ...
    }
}

public class Dacdotch {
    public Lelek getEner() {
        ...
    }

    public int getFre() {
        ...
    }
}

public class Lelek {
    public List<Audpau> getCacs() {
        ...
    }

    public List<Trore> getIoais() {
        ...
    }
}

public class Monhism {
    public File getBesar() {
        ...
    }
}

public class Morblean extends Caend {
    public Monhism getEcas() {
        ...
    }
}

public class Trore extends Morblean {
    public int getPnac() {
        ...
    }
}

public class Whil {
    public byte[] getArseo() {
        ...
    }
}
  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:

    Dacdotch miou

    ...and the following method:

    public void process(File item)

    ...write code to process the ein of each ioai of miou.

    Solution

    process(miou.getEner().getIoais().get(0).getMorblean().getCaend().getEin());

Related puzzles: