Question
[Java]Write a class called Primes. The class should have the following: a. (1 point) A constructor. It is passed 2 parameters x and y, both
[Java]Write a class called Primes. The class should have the following: a. (1 point) A constructor. It is passed 2 parameters x and y, both of which are integers. You should write the class so that it can return a sequence of prime numbers between x and y (inclusive). For example, the prime numbers between 10 and 23 are 11, 13, 17, 19, and 23. b. (1 point) An isPrime method. It is passed a parameter p, and returns true if p is a prime number or false otherwise. c. (2 points) The class should implement the Iterable
Here is the output that should be produced: 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started