Class relationships: Correct Solution


Consider the follow class declarations:

public class Ashrain {
    public byte[] getFla() {
        ...
    }
}

public class Decgil extends Topche {
    public List<Sneed> getPhocs() {
        ...
    }
}

public class Doudmass {
    public byte[] getRioss() {
        ...
    }

    public Munwhe getObu() {
        ...
    }
}

public class Hess extends Urmel {
    public int getVio() {
        ...
    }
}

public class Iedmism {
    public List<Masdi> getElers() {
        ...
    }

    public File getBida() {
        ...
    }
}

public class Masdi extends Saumi {
    public List<Spessess> getTeLias() {
        ...
    }

    public Nunei getOwac() {
        ...
    }
}

public class Munwhe extends Iedmism {
    public Reard getMact() {
        ...
    }
}

public class Nunei {
    public List<Decgil> getChlocs() {
        ...
    }

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

public class Reard {
    public byte[] getEou() {
        ...
    }
}

public class Regleid {
    public String getUeId() {
        ...
    }
}

public class Saumi {
    public List<String> getAufes() {
        ...
    }
}

public class Sneed {
    public File getSaBadi() {
        ...
    }
}

public class Spessess extends Regleid {
    public int getIaAndop() {
        ...
    }
}

public class Topche {
    public Hess getOmesm() {
        ...
    }

    public List<Ashrain> getOtods() {
        ...
    }
}

public class Urmel {
    public Whungren getFifli() {
        ...
    }

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

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

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

    Doudmass pei

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the chre of each chloc of each eler of pei.

    Solution

    process(pei.getObu().getIedmism().getElers().get(0).getOwac().getChlocs().get(0).getTopche().getOmesm().getUrmel().getChre());

Related puzzles: