Class relationships: Correct Solution


Consider the follow class declarations:

public class Anhud {
    public int getMadro() {
        ...
    }
}

public class Gruec {
    public int getNefoc() {
        ...
    }
}

public class Hetad {
    public String getDiHar() {
        ...
    }

    public List<Anhud> getTheris() {
        ...
    }
}

public class Isdut {
    public File getPri() {
        ...
    }

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

public class Neoss {
    public Phastga getTeOw() {
        ...
    }

    public int getIsCiasm() {
        ...
    }
}

public class Phastga {
    public String getChend() {
        ...
    }

    public List<Postcrer> getTephes() {
        ...
    }
}

public class Postcrer extends SqoPhlel {
    public List<Stec> getDuEds() {
        ...
    }
}

public class Psuidi extends Neoss {
    public Wantbrir getChod() {
        ...
    }

    public Hetad getThal() {
        ...
    }
}

public class SqoPhlel {
    public List<String> getKir() {
        ...
    }
}

public class Stec {
    public UmaPoal getFead() {
        ...
    }

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

public class UmaPoal extends Isdut {
    public List<Gruec> getTisses() {
        ...
    }
}

public class Wantbrir {
    public List<String> getGuce() {
        ...
    }
}
  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:

    Psuidi ia

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the suIu of each duEd of each tephe of ia.

    Solution

    process(ia.getNeoss().getTeOw().getTephes().get(0).getDuEds().get(0).getFead().getIsdut().getSuIu());

Related puzzles: