Class relationships: Correct Solution


Consider the follow class declarations:

public class Bero {
    public File getMeRanud() {
        ...
    }

    public Isic getPrus() {
        ...
    }
}

public class Caegeng {
    public PouRehe getIdum() {
        ...
    }

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

public class Contnoe {
    public byte[] getBrua() {
        ...
    }
}

public class DedOsir {
    public String getSpil() {
        ...
    }
}

public class Drodstic extends DedOsir {
    public List<Bero> getZirsts() {
        ...
    }
}

public class Eciam extends Flec {
    public Ugnde getClano() {
        ...
    }
}

public class Flec {
    public List<String> getOin() {
        ...
    }
}

public class Geour extends Caegeng {
    public File getRaa() {
        ...
    }
}

public class Isic extends Prangmal {
    public List<Eciam> getHismos() {
        ...
    }

    public List<Contnoe> getDaFanirs() {
        ...
    }
}

public class Nelest extends Drodstic {
    public String getOng() {
        ...
    }
}

public class PouRehe {
    public int getIoStru() {
        ...
    }

    public Wungmarm getErUhus() {
        ...
    }

    public File getMiEsir() {
        ...
    }
}

public class Prangmal {
    public List<Prif> getIhos() {
        ...
    }

    public Prer getRali() {
        ...
    }
}

public class Prer {
    public String getOpil() {
        ...
    }

    public List<Geour> getItDes() {
        ...
    }
}

public class Prif {
    public List<String> getQamin() {
        ...
    }
}

public class Ugnde {
    public File getElPla() {
        ...
    }
}

public class Wungmarm {
    public int getGeCiot() {
        ...
    }
}
  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:

    Nelest i

    ...and the following method:

    public void process(File item)

    ...write code to process the miEsir of each itDe of each zirst of i.

    Solution

    process(i.getDrodstic().getZirsts().get(0).getPrus().getPrangmal().getRali().getItDes().get(0).getCaegeng().getIdum().getMiEsir());

Related puzzles: