
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Quiz #1B
Name:
READ THE QUESTIONS CAREFULLY!!! DO NOT WASTE TIME DOING MORE THAN IS ASKED FOR. DO NOT IMPLEMENT METHODS UNLESS SPECI- FICIALLY REQUESTED. YOU DO NOT NEED TO COMMENT THE CODE. YOU MAY USE T INSTEAD OF AnyType. IN QUESTION 2 IF YOU INVOKE AN ARRAYLIST METHOD YOU MUST SHOW THE IMPLEMENTATION OF THE METHOD.
Three a essors: ontains returns true if a sp e i ed ob je t is found in the set; returns false otherwise. isEmpty, tests if the List is empty; and size returns the numb er of elements urrently stored in the List ontainer. Two mutators: One makes the List empty; the other (add) inserts a new item.
(a) Implement a zero parameter onstru tor. (b) Implement add. You must expand the array as appropriate.