Listed next is a code skeleton for an interface called


Question: Listed next is a code skeleton for an interface called Enumeration and a class called Name Collection. Enumeration provides an interface to sequentially iterate through some type of collection. In this case, the collection will be the class Name Collection that simply stores a collection of names using an array of strings.

1755_16.png

Complete the method get Enumeration () so that it returns an anonymous inner class that corresponds to the Enumeration interface for the names array in Names Collection. Then write a main method that creates a Names Collection object with a sample array of strings, retrieves the Enumeration for this class via get Enumeration () , and then iterates through the enumeration outputting each name using the get Next() method.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Listed next is a code skeleton for an interface called
Reference No:- TGS02404858

Now Priced at $10 (50% Discount)

Recommended (96%)

Rated (4.8/5)