Skip to content

A simple Java program to check whether a given number is prime. It includes error handling for invalid inputs and uses an optimized algorithm for prime detection. The package name follows best practices, and the program ensures efficient resource management.

License

Notifications You must be signed in to change notification settings

nurulashraf/java-prime-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Java Prime Checker

A simple Java program to check whether a given number is prime. It includes error handling for invalid inputs and uses an optimized algorithm for prime detection. The package follows best practices, and the program ensures efficient resource management.

Features

  • Checks if a number is prime.
  • Handles invalid inputs gracefully.
  • Uses an optimized algorithm for efficiency.

Requirements

  • Java 8 or later

Installation & Usage

  1. Clone the repository:
    git clone https://github.com/nurulashraf/java-prime-checker.git
  2. Navigate to the project directory:
    cd java-prime-checker
  3. Compile the program:
    javac src/primechecker/PrimeChecker.java
  4. Run the program:
    java -cp src primechecker.PrimeChecker

Repository Structure

java-prime-checker/
│── src/
│   └── PrimeChecker.java
│── README.md
└── LICENSE

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A simple Java program to check whether a given number is prime. It includes error handling for invalid inputs and uses an optimized algorithm for prime detection. The package name follows best practices, and the program ensures efficient resource management.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages