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.
- Host: GitHub
- URL: https://github.com/nurulashraf/java-prime-checker
- Owner: nurulashraf
- License: mit
- Created: 2025-02-03T07:20:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-02-03T07:25:13.000Z (5 months ago)
- Last Synced: 2025-02-12T09:55:07.174Z (4 months ago)
- Topics: beginner-friendly, error-handling, java, number-theory, prime-number, simple-java-project
- Language: Java
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.