Class relationships: Correct Solution


Consider the follow class declarations:

public class Asphen {
    public File getHenbo() {
        ...
    }
}

public class Ausva extends Ciasfluint {
    public List<Senar> getPalges() {
        ...
    }
}

public class Cergis {
    public File getCemna() {
        ...
    }
}

public class Ciasfluint {
    public List<Vestos> getMaIds() {
        ...
    }

    public List<Lelial> getSilfes() {
        ...
    }
}

public class Dedrir {
    public int getFeng() {
        ...
    }
}

public class Eham {
    public File getEck() {
        ...
    }
}

public class Henboing {
    public PelPhess getEdarl() {
        ...
    }

    public String getCeesh() {
        ...
    }
}

public class Hocs {
    public int getRuEead() {
        ...
    }
}

public class IarPran extends Hocs {
    public Ausva getParhe() {
        ...
    }
}

public class Idcion extends Malne {
    public List<String> getPalel() {
        ...
    }
}

public class Labiss extends Asphen {
    public List<String> getIol() {
        ...
    }
}

public class Lelial {
    public List<String> getPrema() {
        ...
    }
}

public class Malne {
    public int getCou() {
        ...
    }

    public List<Spoubec> getPorses() {
        ...
    }
}

public class Muqol {
    public String getCoEmdua() {
        ...
    }

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

public class Necesm extends Henboing {
    public List<String> getLal() {
        ...
    }
}

public class OcuHute {
    public List<IarPran> getDatods() {
        ...
    }

    public List<Eham> getSoSiffs() {
        ...
    }
}

public class PelPhess {
    public Cergis getEhMe() {
        ...
    }

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

public class Preng extends Dedrir {
    public Sangbuism getIbux() {
        ...
    }
}

public class Prive extends Muqol {
    public String getEsna() {
        ...
    }
}

public class Sangbuism extends Thonber {
    public List<Labiss> getKias() {
        ...
    }
}

public class Senar {
    public List<String> getQiChau() {
        ...
    }

    public Necesm getEdHilf() {
        ...
    }
}

public class Spoubec {
    public OcuHute getIck() {
        ...
    }

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

public class Thonber {
    public byte[] getWhe() {
        ...
    }

    public List<Idcion> getKacers() {
        ...
    }
}

public class Vestos {
    public Prive getAlent() {
        ...
    }

    public byte[] getPiMiu() {
        ...
    }
}
  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:

    Preng veor

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the esPabse of each maId of the first datod of the first pors of each kacer of veor.

    Solution

    for (Spoubec pors : veor.getIbux().getThonber().getKacers().get(0).getMalne().getPorsesList()) {
        for (IarPran datod : pors.getIck().getDatodsList()) {
            process(datod.getParhe().getCiasfluint().getMaIds().get(0).getAlent().getMuqol().getEsPabse());
        }
    }

Related puzzles: