Class relationships: Correct Solution


Consider the follow class declarations:

public class Alfle extends Palles {
    public List<Premop> getShios() {
        ...
    }
}

public class Awil {
    public List<Siati> getBerias() {
        ...
    }

    public List<Bric> getBles() {
        ...
    }

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

public class Becfea extends Niete {
    public int getBiiac() {
        ...
    }
}

public class Bric {
    public int getTrism() {
        ...
    }
}

public class Cessal {
    public List<String> getOosm() {
        ...
    }
}

public class Daie extends Awil {
    public List<String> getSupo() {
        ...
    }
}

public class Dosscin {
    public List<String> getEck() {
        ...
    }
}

public class Eflu {
    public List<Alfle> getOsids() {
        ...
    }

    public int getQos() {
        ...
    }
}

public class ErmUlfas extends Eflu {
    public File getAlSa() {
        ...
    }
}

public class Ernin {
    public Daie getChrae() {
        ...
    }

    public Preg getArPadwe() {
        ...
    }

    public Cessal getPeci() {
        ...
    }
}

public class Hessbus {
    public ErmUlfas getSimio() {
        ...
    }

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

public class Jacsmess {
    public File getJient() {
        ...
    }
}

public class Mioc {
    public String getCil() {
        ...
    }
}

public class Nena {
    public List<String> getCeIdird() {
        ...
    }
}

public class Niete {
    public Dosscin getPhlon() {
        ...
    }

    public List<Otruct> getOlBacols() {
        ...
    }

    public Ernin getSti() {
        ...
    }
}

public class Otruct {
    public String getBir() {
        ...
    }
}

public class Palles extends Mioc {
    public Toncac getCle() {
        ...
    }
}

public class Plep {
    public int getKiIr() {
        ...
    }

    public List<Hessbus> getRoucs() {
        ...
    }
}

public class Preg {
    public String getFedsu() {
        ...
    }
}

public class Premop extends Jacsmess {
    public String getCuAd() {
        ...
    }
}

public class Siati {
    public String getGudo() {
        ...
    }
}

public class Toncac {
    public Nena getEue() {
        ...
    }

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

    Plep qec

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the beSi of each arten of each osid of each rouc of qec.

    Solution

    process(qec.getRoucs().get(0).getSimio().getEflu().getOsids().get(0).getPalles().getCle().getArtens().get(0).getNiete().getSti().getChrae().getAwil().getBeSi());

Related puzzles: