diff --git a/Beginner/Palindrome.java b/Beginner/Palindrome.java new file mode 100644 index 0000000..959ea4c --- /dev/null +++ b/Beginner/Palindrome.java @@ -0,0 +1,15 @@ +import java.util.Scanner; + +public class Palindrome { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.print("Enter a string: "); + String str = sc.nextLine(); + String reversed = new StringBuilder(str).reverse().toString(); + if(str.equals(reversed)){ + System.out.println(str + " is a palindrome."); + } else { + System.out.println(str + " is not a palindrome."); + } + } +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..26c5e2e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,25 @@ +# Contributing to Java-Programs + +Thank you for considering contributing to this repository! Here's how you can help: + +## How to Contribute + +1. **Fork the repository**: Click on the "Fork" button at the top-right corner of this page. +2. **Clone your fork**: `git clone https://github.com/your-username/Java-Programs.git` +3. **Create a new branch**: `git checkout -b feature/your-feature` +4. **Make your changes**: Implement your feature or fix. +5. **Commit your changes**: `git commit -m 'Add feature: your-feature'` +6. **Push to your branch**: `git push origin feature/your-feature` +7. **Open a pull request**: Go to the "Pull Requests" tab and click "New Pull Request". + +## Code Style + +- Follow Java naming conventions. +- Write clear and concise commit messages. +- Ensure your code is properly indented and formatted. + +## Issues + +If you find any bugs or have suggestions, please open an issue before submitting a pull request. + +Happy coding!