Class relationships: Correct Solution


Consider the follow class declarations:

public class Benspel {
    public File getRacu() {
        ...
    }

    public int getSiOrse() {
        ...
    }
}

public class Elsla extends Rineng {
    public File getRece() {
        ...
    }
}

public class FefLela {
    public byte[] getUesm() {
        ...
    }
}

public class Ingsaft {
    public Praftec getUdis() {
        ...
    }

    public List<Benspel> getEnis() {
        ...
    }
}

public class NoeOstder {
    public List<Pluald> getAdfris() {
        ...
    }

    public List<String> getBrero() {
        ...
    }
}

public class Pluald {
    public List<FefLela> getPneds() {
        ...
    }

    public Uscherth getFahu() {
        ...
    }

    public Teplan getPiSas() {
        ...
    }

    public Elsla getCrur() {
        ...
    }
}

public class Praftec {
    public byte[] getReos() {
        ...
    }
}

public class Rineng extends Ingsaft {
    public byte[] getJesid() {
        ...
    }
}

public class Teplan {
    public List<String> getLel() {
        ...
    }
}

public class Uscherth {
    public File getViEr() {
        ...
    }
}
  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:

    NoeOstder el

    ...and the following method:

    public void process(int item)

    ...write code to process the siOrse of each eni of each adfri of el.

    Solution

    process(el.getAdfris().get(0).getCrur().getRineng().getIngsaft().getEnis().get(0).getSiOrse());

Related puzzles: