Class relationships: Correct Solution


Consider the follow class declarations:

public class Ackiar extends Celclald {
    public int getNionu() {
        ...
    }
}

public class Celclald {
    public String getAmSphos() {
        ...
    }
}

public class Chensest {
    public List<Ackiar> getReengs() {
        ...
    }

    public List<Lemui> getCenas() {
        ...
    }
}

public class Erkish {
    public int getKoc() {
        ...
    }
}

public class Hindsec {
    public List<Ught> getGirs() {
        ...
    }

    public int getAltro() {
        ...
    }
}

public class Jesperd extends Saer {
    public String getEcHo() {
        ...
    }
}

public class Lemui {
    public Hindsec getSiawo() {
        ...
    }

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

public class Ooss {
    public byte[] getOaPa() {
        ...
    }
}

public class Saer {
    public Ooss getSpos() {
        ...
    }

    public Chensest getReava() {
        ...
    }
}

public class Ught extends Erkish {
    public File getTreng() {
        ...
    }

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

    Jesperd il

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the iado of each gir of the first cena of il.

    Solution

    for (Lemui cena : il.getSaer().getReava().getCenasList()) {
        process(cena.getSiawo().getGirs().get(0).getIado());
    }

Related puzzles: