Class relationships: Correct Solution


Consider the follow class declarations:

public class AokFoc {
    public File getLanan() {
        ...
    }
}

public class Bepsoc extends AokFoc {
    public List<Deca> getWels() {
        ...
    }

    public File getStese() {
        ...
    }
}

public class Brestal extends Ronir {
    public Penpran getDaOst() {
        ...
    }
}

public class Deca {
    public int getPhasi() {
        ...
    }
}

public class IloOang {
    public String getBrea() {
        ...
    }

    public Orstau getRar() {
        ...
    }
}

public class Orstau {
    public List<Brestal> getEders() {
        ...
    }

    public String getSeSo() {
        ...
    }
}

public class Penpran {
    public File getRiCed() {
        ...
    }
}

public class Ronir {
    public File getWeis() {
        ...
    }

    public Bepsoc getDeNand() {
        ...
    }
}
  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:

    IloOang te

    ...and the following method:

    public void process(File item)

    ...write code to process the stese of each eder of te.

    Solution

    process(te.getRar().getEders().get(0).getRonir().getDeNand().getStese());

Related puzzles: