Class relationships: Correct Solution


Consider the follow class declarations:

public class Adqa {
    public String getPhumi() {
        ...
    }
}

public class Bodor extends Prenuc {
    public byte[] getRauil() {
        ...
    }
}

public class Cente extends Vellplan {
    public byte[] getTrer() {
        ...
    }

    public int getSom() {
        ...
    }
}

public class Frosmme extends Relpad {
    public List<SloTandres> getPhoods() {
        ...
    }

    public Adqa getOsm() {
        ...
    }
}

public class Mastsi {
    public String getPid() {
        ...
    }
}

public class Prenuc {
    public Mastsi getShra() {
        ...
    }

    public Psisant getEnho() {
        ...
    }
}

public class Psisant {
    public List<String> getPraod() {
        ...
    }

    public List<Frosmme> getCethes() {
        ...
    }
}

public class Relpad {
    public List<Cente> getIsens() {
        ...
    }

    public String getHoa() {
        ...
    }
}

public class SloTandres {
    public String getMosil() {
        ...
    }
}

public class Vellplan {
    public String getNoend() {
        ...
    }
}
  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:

    Bodor miu

    ...and the following method:

    public void process(int item)

    ...write code to process the som of each isen of each cethe of miu.

    Solution

    process(miu.getPrenuc().getEnho().getCethes().get(0).getRelpad().getIsens().get(0).getSom());

Related puzzles: