Class relationships: Correct Solution


Consider the follow class declarations:

public class Acptaid {
    public Smai getIapre() {
        ...
    }

    public List<Daltrio> getCabos() {
        ...
    }
}

public class Bruntthud {
    public File getUbiod() {
        ...
    }
}

public class Daltrio {
    public String getRegic() {
        ...
    }
}

public class Ferchpross {
    public List<String> getEmCu() {
        ...
    }
}

public class Gessoot {
    public int getGian() {
        ...
    }

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

public class IodPec {
    public String getEai() {
        ...
    }
}

public class KurHuili {
    public int getCic() {
        ...
    }
}

public class LelPlosso {
    public IodPec getSepro() {
        ...
    }

    public List<Gessoot> getSwes() {
        ...
    }
}

public class Lissi {
    public int getCeSwia() {
        ...
    }

    public List<Acptaid> getMuMedfos() {
        ...
    }
}

public class Smai extends Thrucsed {
    public File getHosgo() {
        ...
    }
}

public class Thrucsed extends Ucske {
    public Vopri getTuc() {
        ...
    }
}

public class TweMacgess extends Lissi {
    public List<Ferchpross> getCionis() {
        ...
    }
}

public class Ucske {
    public Bruntthud getRusm() {
        ...
    }

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

public class Vopri {
    public List<LelPlosso> getTuses() {
        ...
    }

    public KurHuili getSuCacso() {
        ...
    }
}
  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:

    TweMacgess elfi

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the scoue of each swe of each tus of each muMedfo of elfi.

    Solution

    process(elfi.getLissi().getMuMedfos().get(0).getIapre().getThrucsed().getTuc().getTuses().get(0).getSwes().get(0).getScoue());

Related puzzles: