Class relationships: Correct Solution


Consider the follow class declarations:

public class Asso extends PumMeanjat {
    public File getOcbed() {
        ...
    }
}

public class Beho {
    public int getThi() {
        ...
    }

    public Thaegnos getAuVeed() {
        ...
    }
}

public class Chomvic {
    public byte[] getFawes() {
        ...
    }
}

public class Deedcoun extends MuuSaidme {
    public byte[] getPril() {
        ...
    }
}

public class Huin {
    public File getOcOss() {
        ...
    }
}

public class Iajess extends StoOco {
    public List<Chomvic> getHuants() {
        ...
    }

    public List<Deedcoun> getImases() {
        ...
    }

    public Poplo getIgo() {
        ...
    }
}

public class MuuSaidme {
    public List<String> getCasqa() {
        ...
    }
}

public class NirIngta {
    public List<Iajess> getIsAnpases() {
        ...
    }

    public List<Prunsor> getAdhets() {
        ...
    }
}

public class Phress {
    public int getSteph() {
        ...
    }
}

public class Poplo extends RuoSced {
    public Phress getScim() {
        ...
    }
}

public class Prunsor {
    public String getRaBia() {
        ...
    }
}

public class PumMeanjat extends Beho {
    public Huin getOlMioci() {
        ...
    }
}

public class Recsca {
    public int getEcvan() {
        ...
    }

    public Asso getAnLearm() {
        ...
    }
}

public class RuoSced {
    public String getIbes() {
        ...
    }

    public List<Recsca> getCeOds() {
        ...
    }
}

public class StoOco {
    public List<String> getKicu() {
        ...
    }
}

public class Thaegnos {
    public File getPhue() {
        ...
    }

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

    NirIngta aci

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the chro of each ceOd of each isAnpas of aci.

    Solution

    process(aci.getIsAnpases().get(0).getIgo().getRuoSced().getCeOds().get(0).getAnLearm().getPumMeanjat().getBeho().getAuVeed().getChro());

Related puzzles: