Class relationships: Correct Solution


Consider the follow class declarations:

public class Betron {
    public List<String> getWhu() {
        ...
    }
}

public class Cang {
    public List<String> getDiare() {
        ...
    }
}

public class CelBacne {
    public Diot getEcsoi() {
        ...
    }

    public List<Preossce> getMoAhols() {
        ...
    }
}

public class Censteght {
    public byte[] getAqid() {
        ...
    }

    public Clacliu getEasm() {
        ...
    }
}

public class Chipash extends SqaBatunt {
    public TreFlar getPless() {
        ...
    }
}

public class Clacliu extends Ruism {
    public Dohus getOnpo() {
        ...
    }
}

public class Diot {
    public String getSusa() {
        ...
    }
}

public class Dohus {
    public int getPecco() {
        ...
    }
}

public class Hocsrad extends CelBacne {
    public int getBaci() {
        ...
    }
}

public class Icdic {
    public File getHur() {
        ...
    }
}

public class Lesmui {
    public String getTro() {
        ...
    }
}

public class Losm {
    public List<String> getEaWe() {
        ...
    }

    public Mandmi getEph() {
        ...
    }
}

public class Mandmi extends Cang {
    public List<Hocsrad> getDaWrints() {
        ...
    }

    public List<Piacnish> getStrens() {
        ...
    }
}

public class Piacnish {
    public List<String> getEdAm() {
        ...
    }
}

public class Preossce {
    public Tuctden getBaOqer() {
        ...
    }

    public List<Soec> getTeDuses() {
        ...
    }
}

public class Ruism extends Chipash {
    public byte[] getCeul() {
        ...
    }
}

public class SeoMonprid {
    public String getRisse() {
        ...
    }
}

public class Soec {
    public byte[] getThric() {
        ...
    }
}

public class SqaBatunt {
    public byte[] getBil() {
        ...
    }
}

public class Strei extends Losm {
    public List<SeoMonprid> getUmplis() {
        ...
    }

    public Betron getCio() {
        ...
    }

    public List<Lesmui> getSqeos() {
        ...
    }
}

public class TreFlar {
    public Icdic getIcOnbue() {
        ...
    }

    public int getBisse() {
        ...
    }

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

public class Tuctden {
    public String getAcOcick() {
        ...
    }

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

    Strei e

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the clu of the first gace of the first moAhol of each daWrint of e.

    Solution

    for (Preossce moAhol : e.getLosm().getEph().getDaWrints().get(0).getCelBacne().getMoAholsList()) {
        for (Censteght gace : moAhol.getBaOqer().getGacesList()) {
            process(gace.getEasm().getRuism().getChipash().getPless().getClu());
        }
    }

Related puzzles: