Class relationships: Correct Solution


Consider the follow class declarations:

public class Brobed extends Dulloe {
    public Vess getUnceh() {
        ...
    }
}

public class Creesm {
    public List<String> getGoDira() {
        ...
    }
}

public class Dulloe {
    public Metbo getWhi() {
        ...
    }

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

public class Feare {
    public List<Creesm> getEcings() {
        ...
    }

    public Mamou getNaEdil() {
        ...
    }

    public List<Selldron> getPhorms() {
        ...
    }
}

public class Hessing extends Brobed {
    public String getQong() {
        ...
    }
}

public class Laness extends Feare {
    public List<Lotad> getTecens() {
        ...
    }
}

public class Lotad {
    public File getDath() {
        ...
    }
}

public class Mamou {
    public byte[] getBalma() {
        ...
    }

    public UilVir getDest() {
        ...
    }
}

public class Metbo extends Sluc {
    public List<String> getMoVe() {
        ...
    }
}

public class Pharan {
    public List<Laness> getChions() {
        ...
    }

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

public class Selldron {
    public byte[] getPrur() {
        ...
    }
}

public class Sluc {
    public File getTiLel() {
        ...
    }
}

public class UilVir {
    public File getStro() {
        ...
    }

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

public class Vess {
    public byte[] getCoHecic() {
        ...
    }

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

    Hessing dri

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the seMinir of the first chion of the first ici of dri.

    Solution

    for (Pharan ici : dri.getBrobed().getUnceh().getIcisList()) {
        for (Laness chion : ici.getChionsList()) {
            process(chion.getFeare().getNaEdil().getDest().getSeMinir());
        }
    }

Related puzzles: