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 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
You know the right answer?
Creates a Java Interfaces Creates a class and Objects that implements and the Java Interface
...
Questions
question
Chemistry, 26.03.2021 07:10
question
Mathematics, 26.03.2021 07:10
Questions on the website: 13722363