Class relationships: Correct Solution


Consider the follow class declarations:

public class Angme extends Enpless {
    public int getSuCa() {
        ...
    }

    public int getIaComec() {
        ...
    }
}

public class Caeptred extends Angme {
    public byte[] getParfa() {
        ...
    }
}

public class Dicsio {
    public Caeptred getReio() {
        ...
    }

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

public class Doismdor {
    public byte[] getEron() {
        ...
    }
}

public class Enpless {
    public File getCes() {
        ...
    }
}

public class Fafeo {
    public List<Dicsio> getDeGes() {
        ...
    }

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

public class Plesm {
    public byte[] getPaCas() {
        ...
    }
}

public class Sconur extends Stedsiast {
    public List<Tood> getBubis() {
        ...
    }
}

public class Sphessess {
    public byte[] getInGror() {
        ...
    }

    public List<Plesm> getIalsas() {
        ...
    }
}

public class Stedsiast {
    public Sphessess getRiCim() {
        ...
    }

    public Zackcong getPasar() {
        ...
    }
}

public class Tood {
    public byte[] getIcJi() {
        ...
    }
}

public class Zackcong extends Doismdor {
    public List<Fafeo> getAdLesoks() {
        ...
    }
}
  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:

    Sconur au

    ...and the following method:

    public void process(int item)

    ...write code to process the iaComec of each deGe of the first adLesok of au.

    Solution

    for (Fafeo adLesok : au.getStedsiast().getPasar().getAdLesoksList()) {
        process(adLesok.getDeGes().get(0).getReio().getAngme().getIaComec());
    }

Related puzzles: