Class relationships: Correct Solution


Consider the follow class declarations:

public class Badpront {
    public Ronkint getViCe() {
        ...
    }

    public int getBaUc() {
        ...
    }
}

public class Blou {
    public Sqidpiss getStoec() {
        ...
    }

    public File getEdhu() {
        ...
    }

    public File getAng() {
        ...
    }
}

public class Casmfui extends Blou {
    public List<SulAssael> getHiSisases() {
        ...
    }
}

public class Iciound {
    public int getPui() {
        ...
    }
}

public class Ronkint {
    public List<Sphi> getAnZemics() {
        ...
    }

    public Casmfui getClu() {
        ...
    }
}

public class Shaa {
    public String getLamo() {
        ...
    }

    public List<Shrur> getPuhas() {
        ...
    }
}

public class Shrur extends Badpront {
    public int getAsria() {
        ...
    }
}

public class Sphi extends Iciound {
    public int getTrar() {
        ...
    }
}

public class Sqidpiss {
    public File getMamee() {
        ...
    }
}

public class SulAssael {
    public int getCiNen() {
        ...
    }
}
  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:

    Shaa bil

    ...and the following method:

    public void process(File item)

    ...write code to process the ang of the first puha of bil.

    Solution

    for (Shrur puha : bil.getPuhasList()) {
        process(puha.getBadpront().getViCe().getClu().getBlou().getAng());
    }

Related puzzles: