Class relationships: Correct Solution


Consider the follow class declarations:

public class Antsa {
    public byte[] getGrud() {
        ...
    }
}

public class Bitas extends Dissdea {
    public List<String> getOlFla() {
        ...
    }
}

public class Cisa extends Pedced {
    public List<String> getEsa() {
        ...
    }
}

public class Clurrfro {
    public List<Phag> getRars() {
        ...
    }

    public List<Glest> getVithes() {
        ...
    }
}

public class Dissdea {
    public List<Dresspre> getSwes() {
        ...
    }

    public Melpros getSco() {
        ...
    }
}

public class Dresspre {
    public Cisa getNeCel() {
        ...
    }

    public Stunkre getPusco() {
        ...
    }
}

public class Elpant {
    public List<String> getVabi() {
        ...
    }
}

public class EntNour extends Itaph {
    public Ronrep getAuUlud() {
        ...
    }
}

public class Glest {
    public File getIhen() {
        ...
    }
}

public class Isho {
    public File getCuSo() {
        ...
    }
}

public class Itaph {
    public File getPrac() {
        ...
    }

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

public class Melpros {
    public byte[] getIcesm() {
        ...
    }
}

public class Orchras {
    public List<Elpant> getEsCrases() {
        ...
    }

    public int getChre() {
        ...
    }
}

public class Pedced extends Isho {
    public List<Antsa> getLiNites() {
        ...
    }

    public Clurrfro getVeanu() {
        ...
    }
}

public class Phag extends Orchras {
    public Utau getVen() {
        ...
    }
}

public class Ronrep {
    public File getPlo() {
        ...
    }
}

public class Stunkre {
    public File getErban() {
        ...
    }
}

public class Utau {
    public int getAdBenma() {
        ...
    }

    public List<EntNour> getCeEns() {
        ...
    }
}
  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:

    Bitas poo

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the eis of the first ceEn of the first rar of each swe of poo.

    Solution

    for (Phag rar : poo.getDissdea().getSwes().get(0).getNeCel().getPedced().getVeanu().getRarsList()) {
        for (EntNour ceEn : rar.getVen().getCeEnsList()) {
            process(ceEn.getItaph().getEis());
        }
    }

Related puzzles: