Class relationships: Correct Solution


Consider the follow class declarations:

public class Akant {
    public Lountnel getPrai() {
        ...
    }

    public Iadlos getElus() {
        ...
    }
}

public class Chec {
    public File getDeRanfa() {
        ...
    }
}

public class Deeff {
    public File getBecfu() {
        ...
    }
}

public class Hocs {
    public List<String> getSasen() {
        ...
    }
}

public class Iadlos {
    public int getCaStro() {
        ...
    }
}

public class LilBli {
    public String getNoEwi() {
        ...
    }

    public List<Nauc> getTirs() {
        ...
    }
}

public class Lopnont {
    public List<String> getHorel() {
        ...
    }

    public List<Deeff> getFlengs() {
        ...
    }
}

public class Lountnel extends Volwouwn {
    public Prisbio getNirds() {
        ...
    }
}

public class Nauc extends Tecnac {
    public Akant getIsKno() {
        ...
    }
}

public class Nesen {
    public Thian getEja() {
        ...
    }

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

public class Pimiap extends Wauca {
    public List<String> getSiOeces() {
        ...
    }
}

public class Prerof extends LilBli {
    public File getEwIt() {
        ...
    }
}

public class Prisbio {
    public List<String> getHoUko() {
        ...
    }
}

public class Tecnac {
    public List<String> getEsh() {
        ...
    }
}

public class Thian {
    public Hocs getScoi() {
        ...
    }

    public File getCesh() {
        ...
    }

    public File getDedci() {
        ...
    }
}

public class Tolphial {
    public List<String> getBeGla() {
        ...
    }
}

public class Volwouwn {
    public List<Pimiap> getSoxils() {
        ...
    }

    public List<Tolphial> getPoneds() {
        ...
    }
}

public class Wauca extends Lopnont {
    public List<Chec> getPues() {
        ...
    }

    public List<Nesen> getCrirs() {
        ...
    }
}
  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:

    Prerof ia

    ...and the following method:

    public void process(File item)

    ...write code to process the dedci of each crir of the first soxil of the first tir of ia.

    Solution

    for (Nauc tir : ia.getLilBli().getTirsList()) {
        for (Pimiap soxil : tir.getIsKno().getPrai().getVolwouwn().getSoxilsList()) {
            process(soxil.getWauca().getCrirs().get(0).getEja().getDedci());
        }
    }

Related puzzles: