Class relationships: Correct Solution


Consider the follow class declarations:

public class Biane {
    public List<String> getOss() {
        ...
    }
}

public class Bresh extends Teshi {
    public int getCiCem() {
        ...
    }
}

public class Dios {
    public int getPra() {
        ...
    }

    public Bresh getFlosm() {
        ...
    }
}

public class Iass extends Dios {
    public String getMaa() {
        ...
    }
}

public class Linba {
    public List<Paerir> getBeCesms() {
        ...
    }

    public File getGabta() {
        ...
    }
}

public class Paerir {
    public File getCesso() {
        ...
    }
}

public class Phiaco {
    public File getSes() {
        ...
    }

    public Tirpid getIsi() {
        ...
    }
}

public class Retric {
    public int getCer() {
        ...
    }
}

public class Teshi extends Retric {
    public List<Biane> getShasus() {
        ...
    }

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

public class Tirpid {
    public List<Iass> getEurs() {
        ...
    }

    public Linba getDuthe() {
        ...
    }
}
  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:

    Phiaco lo

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the uirt of the first eur of lo.

    Solution

    for (Iass eur : lo.getIsi().getEursList()) {
        process(eur.getDios().getFlosm().getTeshi().getUirt());
    }

Related puzzles: