Class relationships: Correct Solution


Consider the follow class declarations:

public class Eoll extends Promtra {
    public Sceush getPso() {
        ...
    }
}

public class Ernnor {
    public String getDai() {
        ...
    }

    public Opod getPosa() {
        ...
    }
}

public class Iolan {
    public List<String> getRiess() {
        ...
    }
}

public class Masphost {
    public byte[] getUelal() {
        ...
    }

    public List<Neschod> getDejases() {
        ...
    }
}

public class Neschod {
    public byte[] getOsHism() {
        ...
    }

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

public class Opod {
    public List<Eoll> getOserns() {
        ...
    }

    public Phas getHecen() {
        ...
    }
}

public class Pemel {
    public String getEsoc() {
        ...
    }
}

public class Phas extends Iolan {
    public List<Pemel> getIcOrtros() {
        ...
    }
}

public class Promtra extends Masphost {
    public List<String> getSchu() {
        ...
    }
}

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

    Ernnor u

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the loght of each dejas of each osern of u.

    Solution

    process(u.getPosa().getOserns().get(0).getPromtra().getMasphost().getDejases().get(0).getLoght());

Related puzzles: