Class relationships: Correct Solution


Consider the follow class declarations:

public class Dalwio {
    public File getNawo() {
        ...
    }
}

public class Etbor {
    public int getUaPowha() {
        ...
    }
}

public class Ilept {
    public int getSca() {
        ...
    }
}

public class Ipreang extends Dalwio {
    public List<Sege> getCiRes() {
        ...
    }
}

public class Isstric {
    public Ilept getBrost() {
        ...
    }

    public Phea getValre() {
        ...
    }
}

public class KocOnak extends Vosmpsar {
    public byte[] getMelso() {
        ...
    }
}

public class Mabor extends Isstric {
    public List<TreSner> getIsses() {
        ...
    }
}

public class Phea {
    public List<Ipreang> getLaas() {
        ...
    }

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

public class Porpi {
    public String getPter() {
        ...
    }
}

public class Sege {
    public KocOnak getFlod() {
        ...
    }

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

public class TreSner {
    public File getSli() {
        ...
    }
}

public class Vosmpsar {
    public List<Etbor> getNacs() {
        ...
    }

    public Porpi getJona() {
        ...
    }

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

    Mabor uss

    ...and the following method:

    public void process(File item)

    ...write code to process the plo of each ciRe of the first laa of uss.

    Solution

    for (Ipreang laa : uss.getIsstric().getValre().getLaasList()) {
        process(laa.getCiRes().get(0).getFlod().getVosmpsar().getPlo());
    }

Related puzzles: