subject

Creates a Java Interfaces Creates a class and Objects that implements and the Java Interface
Activity - 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. Instance variables
1. Array of 10 Strings to store the names
2. Partially filled array value to keep track of how many names on in the array
3. Stores current index in the array used by both hasNext and getNext.
3. Constructor
1. Creates the array
2. Sets other instance variable to appropriate starting value.
4. addNames Method - Adds a new name to the array.
3. NameCollection Tester class
1. Creates a NameCollection object
2. Adds at least 5 names to the NameCollection object
3. Displays all the names in the Name Collection Object using the Enumerate Interface methods. This should work for any number of objects in the NameCollection.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What key should you press and hold to select and open multiple files at one time? enter alt control esc
Answers: 1
question
Computers and Technology, 23.06.2019 10:30
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
You know the right answer?
Creates a Java Interfaces Creates a class and Objects that implements and the Java Interface
...
Questions
question
Mathematics, 26.11.2021 22:30
question
Medicine, 26.11.2021 22:30
Questions on the website: 13722359