Question: In Java design the class Primes which implements Iterator (of integers only). It needs to be prime number generator. Each call of next) on it
In Java design the class Primes which implements Iterator (of integers only). It needs to be prime number generator. Each call of next) on it returns the next prime number after the last one that was returned. The class needs to have the following methods: default constructor public boolean hasNextO II will have to always return true public Integer next calculates the next prime number and returns it public void remove) Ishould throw an exception because such method does not Also Write the driver class which tests each of the methods make sense in this particular class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
