Question: please use Java. Thanks! Write a class Triple that contains a single array with exactly three elements, 1, 2 and 3. Then write a custom
please use Java. Thanks!
Write a class Triple that contains a single array with exactly three elements, 1, 2 and 3. Then write a custom Iterator1 For Triple such that the iterator will return an endless repeating sequence of the array elements-. Use the iterator to print a sequence of ten items from your array using exactly this mainO: public static void main (String[] args) ( Triple t = new Triple(); Iterator ti - t.iterator) for (int i = 0; i 10; i++) if (ti.hasNext )) System.out.print (ti.next "") System.out.println(); // prints 1 2 3 1231 2 3 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
