Class relationships: Correct Solution


Consider the follow class declarations:

public class Chopriouss extends TruIrsmup {
    public String getCioul() {
        ...
    }
}

public class Crar {
    public Ecas getTaRert() {
        ...
    }

    public File getSmol() {
        ...
    }
}

public class Despu {
    public int getDant() {
        ...
    }

    public int getWua() {
        ...
    }
}

public class Ecas {
    public byte[] getBaPae() {
        ...
    }
}

public class Edsweac {
    public Snapo getMup() {
        ...
    }

    public String getTiss() {
        ...
    }
}

public class Poscir {
    public String getPid() {
        ...
    }
}

public class Snapo {
    public Despu getEssec() {
        ...
    }

    public List<Crar> getEces() {
        ...
    }
}

public class TruIrsmup {
    public List<Poscir> getCaas() {
        ...
    }

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

    Chopriouss grou

    ...and the following method:

    public void process(int item)

    ...write code to process the wua of each anco of grou.

    Solution

    process(grou.getTruIrsmup().getAncos().get(0).getMup().getEssec().getWua());

Related puzzles: