Introduction
In this lab, you will learn how to check if a number is prime in Java. We will start by implementing a basic loop to determine primality.
Next, we will optimize the prime checking process by utilizing the square root of the number. Finally, we will enhance the code to handle negative and non-integer inputs gracefully.