Class relationships: Correct Solution


Consider the follow class declarations:

public class Bothiss extends Esnirth {
    public Cenghoe getSphad() {
        ...
    }
}

public class Cenghoe extends Scio {
    public List<String> getNes() {
        ...
    }
}

public class Chuar {
    public String getSiFi() {
        ...
    }
}

public class Esnirth {
    public List<String> getSphi() {
        ...
    }
}

public class Scio {
    public List<Chuar> getSoors() {
        ...
    }

    public List<Seda> getBlecses() {
        ...
    }
}

public class Seda {
    public byte[] getAcMi() {
        ...
    }

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

    Bothiss ec

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the edear of each blecs of ec.

    Solution

    process(ec.getSphad().getScio().getBlecses().get(0).getEdear());

Related puzzles: