Class relationships: Correct Solution


Consider the follow class declarations:

public class ArdRontherd {
    public byte[] getSperi() {
        ...
    }

    public List<Oros> getFuris() {
        ...
    }
}

public class Bimstred {
    public int getAwBii() {
        ...
    }

    public int getPaaf() {
        ...
    }
}

public class Crissphea {
    public String getFep() {
        ...
    }
}

public class DraTroral {
    public int getOrsqe() {
        ...
    }
}

public class Eamesm {
    public Piad getWra() {
        ...
    }

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

public class Gria {
    public ArdRontherd getHiSlac() {
        ...
    }

    public List<Racti> getNoClas() {
        ...
    }
}

public class Inos extends Crissphea {
    public int getQesca() {
        ...
    }
}

public class Lainfrea extends Prash {
    public List<String> getLirt() {
        ...
    }
}

public class Oros extends Vodia {
    public OssGinfel getMaAr() {
        ...
    }
}

public class OssGinfel {
    public File getUcWass() {
        ...
    }
}

public class Piad extends Bimstred {
    public List<Inos> getOulds() {
        ...
    }
}

public class Plol extends Gria {
    public DraTroral getAdMi() {
        ...
    }
}

public class Prash {
    public String getGri() {
        ...
    }
}

public class Racti {
    public byte[] getHias() {
        ...
    }
}

public class Sple {
    public List<Plol> getReEaesses() {
        ...
    }

    public int getPerso() {
        ...
    }
}

public class Vodia {
    public Eamesm getMifue() {
        ...
    }

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

    Sple umoh

    ...and the following method:

    public void process(int item)

    ...write code to process the paaf of each furi of the first reEaess of umoh.

    Solution

    for (Plol reEaess : umoh.getReEaessesList()) {
        process(reEaess.getGria().getHiSlac().getFuris().get(0).getVodia().getMifue().getWra().getBimstred().getPaaf());
    }

Related puzzles: