Class relationships: Correct Solution


Consider the follow class declarations:

public class Beadstad {
    public String getSoHatis() {
        ...
    }
}

public class Borrell {
    public int getNec() {
        ...
    }

    public int getBiFla() {
        ...
    }
}

public class Cang extends Menschel {
    public byte[] getZeffe() {
        ...
    }
}

public class CasUsting {
    public List<String> getOshoc() {
        ...
    }
}

public class Gofalm {
    public CasUsting getTaPu() {
        ...
    }

    public Ulwhe getWaLiees() {
        ...
    }
}

public class Ieci extends Beadstad {
    public List<Iped> getFiIases() {
        ...
    }
}

public class Iped {
    public File getKhas() {
        ...
    }
}

public class Mefa extends Ieci {
    public Borrell getLetad() {
        ...
    }
}

public class Menschel {
    public List<Mefa> getSakdas() {
        ...
    }

    public byte[] getEwn() {
        ...
    }
}

public class Ulwhe {
    public List<Cang> getIlfis() {
        ...
    }

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

    Gofalm es

    ...and the following method:

    public void process(int item)

    ...write code to process the biFla of each sakda of the first ilfi of es.

    Solution

    for (Cang ilfi : es.getWaLiees().getIlfisList()) {
        process(ilfi.getMenschel().getSakdas().get(0).getLetad().getBiFla());
    }

Related puzzles: