Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 20:00, darlene93
An excel which cell contains =b2 is copied to row below, the same column. what will be the new cell's content
Answers: 2
image
Computers and Technology, 22.06.2019 18:10, o10922025
Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to the power of the second parameter. write a statement that calls to_the_power_of to compute the value of cube_side raised to the power of 3 and that associates this value with cube_volume.
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, manlyman31
Selling a product through an electronic medium is
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, rscvsdfsrysas3712
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
Do you know the correct answer?
Creates a Java Interfaces Creates a class and Objects that implements and the Java Interface
...

Questions in other subjects:

Konu
Mathematics, 22.09.2020 18:01
Konu
Social Studies, 22.09.2020 18:01
Konu
Geography, 22.09.2020 18:01