Class relationships: Correct Solution


Consider the follow class declarations:

public class Azen extends VepPaes {
    public List<Nismkoc> getAsHiams() {
        ...
    }
}

public class Bihprong {
    public List<Proanuf> getBosins() {
        ...
    }

    public File getPaDul() {
        ...
    }
}

public class Cind {
    public File getOssit() {
        ...
    }
}

public class Cirtar {
    public Etel getCaCriat() {
        ...
    }

    public List<Pued> getSirles() {
        ...
    }

    public Cind getFepri() {
        ...
    }
}

public class Curi {
    public File getBic() {
        ...
    }
}

public class Etel {
    public byte[] getFeos() {
        ...
    }
}

public class Hentra extends SkaBamoi {
    public Cirtar getIong() {
        ...
    }
}

public class Metjac {
    public File getSoRonts() {
        ...
    }

    public List<Olpil> getKuPelens() {
        ...
    }
}

public class NenPidkol {
    public List<Azen> getIdOucs() {
        ...
    }

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

public class Nismkoc extends Curi {
    public File getOmo() {
        ...
    }
}

public class Olpil {
    public File getAlEphu() {
        ...
    }
}

public class Plen extends Bihprong {
    public int getUrCou() {
        ...
    }
}

public class Proanuf {
    public Hentra getQoVem() {
        ...
    }

    public Metjac getBasas() {
        ...
    }
}

public class Pued {
    public int getGril() {
        ...
    }

    public int getTooa() {
        ...
    }
}

public class SkaBamoi {
    public File getLel() {
        ...
    }
}

public class VepPaes {
    public File getBress() {
        ...
    }

    public Plen getMuFilta() {
        ...
    }
}
  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:

    NenPidkol su

    ...and the following method:

    public void process(int item)

    ...write code to process the tooa of the first sirle of the first bosin of each idOuc of su.

    Solution

    for (Proanuf bosin : su.getIdOucs().get(0).getVepPaes().getMuFilta().getBihprong().getBosinsList()) {
        for (Pued sirle : bosin.getQoVem().getIong().getSirlesList()) {
            process(sirle.getTooa());
        }
    }

Related puzzles: