Class relationships: Correct Solution


Consider the follow class declarations:

public class Aian extends SiwGosa {
    public File getSeRiorm() {
        ...
    }
}

public class Brehur extends Phreven {
    public Pedpnuen getNuBoass() {
        ...
    }
}

public class Clesess {
    public int getPel() {
        ...
    }
}

public class Cocan {
    public Ipas getMori() {
        ...
    }

    public Rousom getCoFo() {
        ...
    }
}

public class Durk {
    public List<String> getIsgre() {
        ...
    }
}

public class Ipas {
    public List<String> getCuVe() {
        ...
    }
}

public class NenLerd {
    public List<String> getChoi() {
        ...
    }
}

public class Neso {
    public List<Brehur> getSeses() {
        ...
    }

    public String getStin() {
        ...
    }
}

public class Osscost extends RoaBoto {
    public Tiss getPeDed() {
        ...
    }
}

public class Pedpnuen extends Clesess {
    public NenLerd getPra() {
        ...
    }
}

public class Phreven {
    public List<Durk> getVaNasris() {
        ...
    }

    public List<Spen> getAngmis() {
        ...
    }
}

public class RoaBoto {
    public List<Cocan> getLaStaus() {
        ...
    }

    public List<Unac> getWovus() {
        ...
    }
}

public class Rousom {
    public int getEnZaes() {
        ...
    }

    public Neso getThama() {
        ...
    }
}

public class SiwGosa {
    public int getOmHethu() {
        ...
    }

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

public class Spen {
    public Aian getIge() {
        ...
    }

    public List<Tecsge> getErBrels() {
        ...
    }
}

public class Tecsge {
    public byte[] getTeo() {
        ...
    }
}

public class Tiss {
    public List<String> getHifra() {
        ...
    }
}

public class Unac {
    public List<String> getShein() {
        ...
    }
}
  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:

    Osscost ga

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the sqavo of the first angmi of each ses of each laStau of ga.

    Solution

    for (Spen angmi : ga.getRoaBoto().getLaStaus().get(0).getCoFo().getThama().getSeses().get(0).getPhreven().getAngmisList()) {
        process(angmi.getIge().getSiwGosa().getSqavo());
    }

Related puzzles: