Class relationships: Correct Solution


Consider the follow class declarations:

public class Aicon {
    public Hidon getNond() {
        ...
    }

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

public class Cinde {
    public List<String> getIali() {
        ...
    }
}

public class Cisal extends Fecbe {
    public List<Aicon> getCueuds() {
        ...
    }
}

public class Drilid extends FesCamo {
    public byte[] getMoime() {
        ...
    }
}

public class Elad {
    public Phusttes getPiOr() {
        ...
    }

    public String getErOdboi() {
        ...
    }
}

public class Esai {
    public Elad getIxIbsce() {
        ...
    }

    public Jongi getCego() {
        ...
    }

    public List<Strinch> getGeEeses() {
        ...
    }
}

public class Fecbe {
    public File getVomah() {
        ...
    }

    public List<Esai> getIsmils() {
        ...
    }
}

public class FesCamo {
    public List<Cinde> getGemdes() {
        ...
    }

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

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

public class Hidon {
    public String getNocod() {
        ...
    }
}

public class Jongi extends Pitse {
    public List<String> getCoCios() {
        ...
    }
}

public class Latfan {
    public Cisal getKnide() {
        ...
    }

    public String getWocs() {
        ...
    }
}

public class LemIalwuss {
    public byte[] getKneag() {
        ...
    }
}

public class Phusttes {
    public List<String> getZai() {
        ...
    }
}

public class Pitse {
    public File getEgh() {
        ...
    }

    public List<Trer> getItgnos() {
        ...
    }
}

public class Strinch {
    public List<String> getUcBesm() {
        ...
    }
}

public class Trer {
    public Drilid getEsh() {
        ...
    }

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

    Latfan iet

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the pra of each itgno of the first ismil of iet.

    Solution

    for (Esai ismil : iet.getKnide().getFecbe().getIsmilsList()) {
        process(ismil.getCego().getPitse().getItgnos().get(0).getEsh().getFesCamo().getPra());
    }

Related puzzles: