Question: Java Implement a program that creates a Java Interface that iterates through objects in some sort of collection. Enumerate Interface methods hasNext - Returns true

Java

Implement a program that creates a Java Interface that iterates through objects in some sort of collection.

  1. Enumerate Interface methods
    1. hasNext - Returns true if another element in the collection exists
    2. getNext - Returns the next element in the collection as an Object class object.
  2. NameCollection class
    1. Implements the Enumerate Interface
    2. Constructor takes in an array of names (Strings) and stores that array
  3. NameCollectionTester class
    1. Creates a NameCollection object
    2. Displays all the names in the NameCollection Object.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!