An open API service indexing awesome lists of open source software.

https://github.com/nurulashraf/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 name follows best practices, and the program ensures efficient resource management.
https://github.com/nurulashraf/java-prime-checker

beginner-friendly error-handling java number-theory prime-number simple-java-project

Last synced: 3 months ago
JSON representation

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.

Awesome Lists containing this project

README

        

# 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:
```sh
git clone https://github.com/nurulashraf/java-prime-checker.git
```
2. Navigate to the project directory:
```sh
cd java-prime-checker
```
3. Compile the program:
```sh
javac src/primechecker/PrimeChecker.java
```
4. Run the program:
```sh
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](LICENSE) file for details.