Prime Number Problem
A prime number is a natural number greater than 1 that is not a product of two smaller natural numbers. Your task is to create a method that tests a Long number input to see if it is a prime number. Below is a list of sample prime numbers you can use for testing:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101.
Your method should return true if it is prime and false if it is not.
The goal of your method is to:
-
Return the correct result
-
Be as efficient as possible so that your method will perform well
-
Be robust so it does not fail
The method signature you are required to use is:
boolean isPrime(Long number)