Class relationships: Correct Solution


Consider the follow class declarations:

public class Irddel {
    public List<String> getLumon() {
        ...
    }
}

public class LolTiol {
    public File getMiost() {
        ...
    }
}

public class Masm extends Setrec {
    public String getAsIc() {
        ...
    }
}

public class Palu {
    public byte[] getCin() {
        ...
    }

    public File getAsm() {
        ...
    }
}

public class Pangpa extends LolTiol {
    public byte[] getTrusm() {
        ...
    }
}

public class Sacsan {
    public List<Masm> getCoNurcs() {
        ...
    }

    public int getPrond() {
        ...
    }
}

public class Setrec {
    public List<Pangpa> getLamirs() {
        ...
    }

    public Spac getBuSteo() {
        ...
    }
}

public class Spac {
    public List<Irddel> getHeNers() {
        ...
    }

    public Palu getOcUwal() {
        ...
    }
}
  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:

    Sacsan pe

    ...and the following method:

    public void process(File item)

    ...write code to process the asm of each coNurc of pe.

    Solution

    process(pe.getCoNurcs().get(0).getSetrec().getBuSteo().getOcUwal().getAsm());

Related puzzles: