Class relationships: Correct Solution


Consider the follow class declarations:

public class Bingca {
    public int getArZa() {
        ...
    }
}

public class Compu {
    public List<String> getDeshi() {
        ...
    }
}

public class Dildoer {
    public byte[] getGoft() {
        ...
    }
}

public class Ewwhant {
    public List<SpoAfes> getFacses() {
        ...
    }

    public List<Mabas> getOsses() {
        ...
    }
}

public class Girltin {
    public List<String> getRird() {
        ...
    }
}

public class Lalmid extends Preias {
    public List<String> getPhuph() {
        ...
    }
}

public class Mabas {
    public File getGrer() {
        ...
    }
}

public class Mioa {
    public File getEpruc() {
        ...
    }

    public String getMiBrece() {
        ...
    }
}

public class Noct {
    public List<String> getPoPles() {
        ...
    }
}

public class Painfar extends Pelan {
    public List<Steuste> getUhMenons() {
        ...
    }
}

public class Pelan {
    public Preana getIlPhir() {
        ...
    }

    public Lalmid getIuss() {
        ...
    }
}

public class Phrio {
    public String getDaPreme() {
        ...
    }

    public Ewwhant getEdon() {
        ...
    }
}

public class Poacun extends Phrio {
    public List<String> getLol() {
        ...
    }
}

public class Preana extends Smoswa {
    public List<String> getCece() {
        ...
    }
}

public class Preias {
    public Psaght getPrigo() {
        ...
    }

    public Bingca getPerbe() {
        ...
    }
}

public class Psaght extends Noct {
    public List<Poacun> getTasmes() {
        ...
    }
}

public class Riorter {
    public List<Girltin> getMubos() {
        ...
    }

    public List<Painfar> getMucs() {
        ...
    }
}

public class Smoswa {
    public int getInwo() {
        ...
    }

    public Dildoer getWous() {
        ...
    }
}

public class SpoAfes extends Compu {
    public Mioa getEnLome() {
        ...
    }
}

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

    Riorter os

    ...and the following method:

    public void process(String item)

    ...write code to process the miBrece of each facs of each tasme of the first muc of os.

    Solution

    for (Painfar muc : os.getMucsList()) {
        process(muc.getPelan().getIuss().getPreias().getPrigo().getTasmes().get(0).getPhrio().getEdon().getFacses().get(0).getEnLome().getMiBrece());
    }

Related puzzles: