
This repository is a hand-picked collection of Java programs, designed specifically for new and seasoned contributors to participate in Hacktoberfest 2025!
Whether you're looking for simple introductory programs to make your first commit or searching for challenging algorithms, this is the perfect place to contribute and level up your Java skills.
Dive into the code, fix bugs, add new features, or contribute your own unique Java program. Let's make this the most vibrant Java resource for Hacktoberfest!
- Beginner Programs: Simple programs (e.g., Prime Number Checker, Factorial).
- Data Structures & Algorithms: Implementations of common DS&A in Java.
- Object-Oriented Programming (OOP) Examples: Clear demonstrations of Java OOP principles.
- Utility Snippets: Useful Java code for common tasks.
Ready to contribute? It's simple! Follow these steps to get your first contribution in:
- Star ⭐ and Fork 🍴 this repository.
- Clone your forked repository to your local machine:
git clone [https://github.com/](https://github.com/)IamBisrutPyne/Java-Programs.git
- Create a new branch for your contribution:
git checkout -b feature/<your-feature-name>
- Add your Java program (e.g.,
MyAwesomeProgram.java
) into the appropriate subfolder (e.g.,Beginner/
orAlgorithms/
). - Commit your changes:
git commit -m "feat: Add My Awesome Program for Hacktoberfest"
- Push your branch to your forked repository:
git push origin feature/<your-feature-name>
- Create a Pull Request (PR) from your forked repository back to the main
Java-Programs
repository.
❗ Important: Please ensure your code follows our Contributing Guidelines!
To give contributors a taste of the content and required coding style, here is a quick example of a clean Java program you might find or contribute.
A clean, commented, and well-formatted Java file is key!
/**
* Program to check if a given number is a Disarium Number.
* A Disarium Number is a number where the sum of its digits raised to their respective positions equals the number itself.
*/
import java.util.*;
public class DisariumNumber {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
System.out.print("Enter a number: ");
int a = sc.nextInt();
if (isDisarium(a)) {
System.out.println("Disarium");
} else {
System.out.println("Not Disarium");
}
}
}
public static boolean isDisarium(int n) {
int sum = 0;
String numStr = String.valueOf(n);
for (int i = 0; i < numStr.length(); i++) {
int digit = numStr.charAt(i) - '0';
sum += (int) Math.pow(digit, i + 1);
}
return sum == n;
}
}