Class relationships: Correct Solution


Consider the follow class declarations:

public class Attin extends Unttwa {
    public int getIsChoce() {
        ...
    }
}

public class CeaStarpre {
    public List<NacPradeng> getMiaecs() {
        ...
    }

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

public class Cerl {
    public String getCelu() {
        ...
    }

    public List<LolSados> getNois() {
        ...
    }
}

public class Cethui {
    public List<Attin> getOngs() {
        ...
    }

    public String getChio() {
        ...
    }
}

public class Cosssci extends Prorde {
    public List<Funzir> getStins() {
        ...
    }

    public List<Ptos> getOdtets() {
        ...
    }
}

public class Deengdi {
    public String getRui() {
        ...
    }
}

public class Faenso {
    public ThiTreth getMiarg() {
        ...
    }

    public String getCim() {
        ...
    }
}

public class Funzir {
    public List<Pigh> getSibmes() {
        ...
    }

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

public class LolSados {
    public String getReeng() {
        ...
    }

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

public class Mismgas {
    public String getMinch() {
        ...
    }
}

public class NacPradeng {
    public byte[] getPri() {
        ...
    }
}

public class Pigh {
    public String getOsBiel() {
        ...
    }
}

public class Prorde {
    public byte[] getMotud() {
        ...
    }
}

public class Ptos extends Puid {
    public CeaStarpre getScim() {
        ...
    }
}

public class Puid {
    public int getFaGla() {
        ...
    }

    public Cethui getRaHiol() {
        ...
    }
}

public class Restia extends Cosssci {
    public int getArCicar() {
        ...
    }
}

public class Temhesm {
    public File getCiReoje() {
        ...
    }
}

public class Thassrhal {
    public File getOksel() {
        ...
    }
}

public class ThiTreth extends Thassrhal {
    public Mismgas getNaBa() {
        ...
    }

    public List<Restia> getOuls() {
        ...
    }

    public Temhesm getSpen() {
        ...
    }
}

public class Unttwa {
    public Cerl getPrell() {
        ...
    }

    public Deengdi getPluza() {
        ...
    }
}
  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:

    Faenso re

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the iss of each noi of the first ong of each odtet of each oul of re.

    Solution

    for (Attin ong : re.getMiarg().getOuls().get(0).getCosssci().getOdtets().get(0).getPuid().getRaHiol().getOngsList()) {
        process(ong.getUnttwa().getPrell().getNois().get(0).getIss());
    }

Related puzzles: