Problem Statement
Class name: PrimeFinder Method name: getPrime Parameters: int Returns: int Implement a class PrimeFinder that contains the method getPrime. getPrime takes an integer x as a parameter and returns the smallest prime number greater than x. *For this problem, a prime number is defined as any nonnegative integer with only two unique nonnegative divisors: itself and 1. The method of the signature is: public int getPrime (int x); *x must satisfy 0 <= x <= 1000000. Examples: -If x=6, then the method should return 7. -If x=13, then the method should return 17.
Definition
- Class:
- PrimeFinder
- Method:
- getPrime
- Parameters:
- int
- Returns:
- int
- Method signature:
- int getPrime(int param0)
- (be sure your method is public)
Constraints
Examples
No public sample cases were explicitly marked for this problem in the original data.