Class relationships: Correct Solution


Consider the follow class declarations:

public class AnoLedu {
    public List<Pelcusm> getAsefs() {
        ...
    }

    public Spess getEoPaian() {
        ...
    }

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

public class Elqing extends AnoLedu {
    public Skar getPraha() {
        ...
    }
}

public class Iscle {
    public int getStri() {
        ...
    }
}

public class Itran {
    public File getShasm() {
        ...
    }

    public List<RarHeu> getDaucs() {
        ...
    }
}

public class Meaftpil {
    public String getDenmi() {
        ...
    }

    public Poulan getSint() {
        ...
    }
}

public class Pelcusm {
    public File getTrost() {
        ...
    }
}

public class Phructi extends Itran {
    public List<String> getGeco() {
        ...
    }
}

public class Poulan extends Whol {
    public List<Unpe> getEchuls() {
        ...
    }

    public List<Sceff> getLaAeans() {
        ...
    }
}

public class RarHeu {
    public String getSpoas() {
        ...
    }

    public Meaftpil getReForn() {
        ...
    }
}

public class Sceff {
    public Iscle getErMi() {
        ...
    }

    public String getIrPel() {
        ...
    }
}

public class Skar {
    public File getEasud() {
        ...
    }
}

public class Spess {
    public int getDePla() {
        ...
    }
}

public class Unpe extends Elqing {
    public File getHess() {
        ...
    }
}

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

    Phructi hino

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the gilil of each echul of each dauc of hino.

    Solution

    process(hino.getItran().getDaucs().get(0).getReForn().getSint().getEchuls().get(0).getElqing().getAnoLedu().getGilil());

Related puzzles: