Question: I am asked to compile the following specification in Eclipse, it is not compiling and giving errors. I cannot answer the following questions that requires
I am asked to compile the following specification in Eclipse, it is not compiling and giving errors. I cannot answer the following questions that requires the following specification to compile, please help.
public static Listtail (List list) { // REQUIRES: ??? // EFFECTS: ??? List result = new ArrayList list); result.remove(0); return result; }
1. What does the implementation of tail do in each of the following cases?
(a) list = null
(b) list = []
(c) list = [1]
(d) list = [1, 2, 3]
2. Write a partial specification that matches the "happy path" part of the implementation's behavior.
3. Rewrite the specification to be total. Use Bloch's standard exceptions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
