Class relationships: Correct Solution


Consider the follow class declarations:

public class AsmMesstra extends Lallnu {
    public List<Pagred> getSuics() {
        ...
    }
}

public class Caced {
    public AsmMesstra getUdCet() {
        ...
    }

    public File getEaMo() {
        ...
    }
}

public class Lallnu {
    public String getPhaai() {
        ...
    }
}

public class MicPri {
    public List<String> getAon() {
        ...
    }

    public int getArWhiac() {
        ...
    }
}

public class Pagred extends MicPri {
    public Whoseng getNappi() {
        ...
    }
}

public class Whoseng {
    public byte[] getHeont() {
        ...
    }
}
  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:

    Caced tru

    ...and the following method:

    public void process(int item)

    ...write code to process the arWhiac of each suic of tru.

    Solution

    process(tru.getUdCet().getSuics().get(0).getMicPri().getArWhiac());

Related puzzles: