Class relationships: Correct Solution


Consider the follow class declarations:

public class Bresh extends Gralfic {
    public CicStiestches getMoung() {
        ...
    }
}

public class Castgon {
    public HusSciol getRoa() {
        ...
    }

    public String getViNal() {
        ...
    }
}

public class Ceash {
    public List<String> getOght() {
        ...
    }
}

public class CicStiestches {
    public int getCiIrde() {
        ...
    }
}

public class Ejak {
    public String getUfrel() {
        ...
    }

    public int getEdAdes() {
        ...
    }
}

public class Gralfic extends Telou {
    public List<Odil> getJoKos() {
        ...
    }

    public List<Castgon> getEvics() {
        ...
    }
}

public class HusSciol extends StiIsto {
    public Pessga getErt() {
        ...
    }
}

public class Licing extends Ejak {
    public List<Ceash> getBeGliacs() {
        ...
    }
}

public class Odil {
    public List<String> getAlGirk() {
        ...
    }
}

public class Pessga {
    public List<Licing> getIbgens() {
        ...
    }

    public String getUis() {
        ...
    }
}

public class StiIsto {
    public List<String> getCed() {
        ...
    }
}

public class Telou {
    public File getPaPle() {
        ...
    }
}
  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:

    Bresh eai

    ...and the following method:

    public void process(int item)

    ...write code to process the edAdes of each ibgen of each evic of eai.

    Solution

    process(eai.getGralfic().getEvics().get(0).getRoa().getErt().getIbgens().get(0).getEjak().getEdAdes());

Related puzzles: