Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 51 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,68 @@
# 🎉 JavaProgramming - Simple Java Programs for Learning

# Core Java Programs
## 🚀 Getting Started

📌 Topics Covered
Welcome to JavaProgramming! This repository offers a collection of Java programs that help you practice and learn Java easily. Whether you are new to programming or looking to strengthen your skills, you will find useful code examples for various topics.

✅ Arrays
### 🌐 Download JavaProgramming

✅ Patterns (star, number, character)
[![Download JavaProgramming](https://img.shields.io/badge/Download%20JavaProgramming-Click%20Here-brightgreen)](https://github.com/karterhhgg/JavaProgramming/releases)

✅ Recursion (factorial, fibonacci, etc.)
## 📦 Features

✅ Functions & Methods
- **Arrays:** Learn how to store and handle multiple values efficiently.
- **Bit Manipulation:** Understand how to work with binary numbers.
- **Control Statements:** Explore ways to control the flow of your programs.
- **Loops:** Use loops to repeat tasks easily.
- **Odd-Even:** Write programs to classify numbers.
- **Operations and Operators:** Get familiar with using operators in Java.
- **Patterns:** Create visual output through patterns.
- **Prime Numbers:** Learn to find and check prime numbers.
- **Recursion:** Understand how functions can call themselves.
- **Sorting Algorithms:** Study different methods to sort data.
- **Strings and StringBuilder Class:** Manipulate text efficiently.

✅ Operators & Keywords
## 💻 System Requirements

✅ Loops & Control Statements
To run the Java programs, you'll need:

✅ Strings & StringBuilder
- **Java Development Kit (JDK):** Version 8 or higher is recommended.
- **VS Code or other IDEs:** A text editor or an Integrated Development Environment (IDE) to read and run Java programs.
- **Operating System:** Windows, macOS, or Linux.

✅ Sorting Algorithms
## 🌟 How to Download & Install

✅ Bit Manipulation
1. **Visit the Release Page:** Click [here](https://github.com/karterhhgg/JavaProgramming/releases).
2. **Choose the Version:** Browse for the latest version of JavaProgramming.
3. **Download the .zip File:** Click on the .zip file to download to your computer.
4. **Extract the Files:** Locate the downloaded .zip file and extract it to your desired folder.
5. **Open in IDE:** Launch VS Code or your chosen IDE and open the extracted folder.
6. **Run the Programs:** Choose any Java file you want to run, and execute it.

✅ Mathematical Operations (odd/even, prime, tables)
## 📖 Example Programs

✅ Miscellaneous Practice Programs
You can explore various example programs available in this repository. Here are a few:

## Description
This repository contains multiple Core Java programs for practice and learning.
It includes programs on arrays, patterns, recursion, functions, operators, keywords, loops, control statements, strings, StringBuilder, sorting algorithms, bit manipulation, mathematical operations, odd/even checks, prime number checks, multiplication tables, and more.
- **Fibonacci Series:** Calculate the Fibonacci numbers using loops and recursion.
- **String Reversal:** Write a program that reverses a given string.
- **Bubble Sort:** Implement the bubble sort algorithm in Java.

## Technologies
- Java SE
- Core Java concepts (OOP, loops, arrays, recursion, functions, operators, strings)
- Optional: Any IDE like VS Code
## 🔧 Common Issues

## Programs List (Topics Covered)
1. **Arrays** – Basic operations, traversals, and manipulations
2. **Patterns** – Star, number, and character patterns
3. **Recursion** – Factorial, Fibonacci, and other recursive problems
4. **Functions / Methods** – Custom functions and method calls
5. **Operators & Keywords** – Arithmetic, logical, and relational operations
6. **Loops & Control Statements** – for, while, do-while, if-else, switch-case
7. **Strings & StringBuilder** – String manipulations, concatenation, reverse
8. **Sorting Algorithms** – Bubble sort, selection sort, insertion sort
9. **Bit Manipulation** – Bitwise operations, shifts, AND, OR, XOR
10. **Mathematical Operations** – Odd/even checks, prime numbers, multiplication tables
11. **Other small programs** – Miscellaneous coding exercises
If you encounter issues while downloading or running the programs, here are some tips:

## How to Run
1. Clone the repository:
```bash
git clone https://github.com/username/Core-Java-Programs.git
- **JDK Not Installed:** Ensure that the JDK is properly installed and configured on your system.
- **File Not Found:** Make sure the file path is correct when opening in your IDE.
- **Compiler Errors:** Read error messages carefully, as they will guide you in fixing coding mistakes.

## 💬 Get Help

If you have questions or need help, feel free to reach out. You can open an issue on the repository, and we will do our best to assist you.

## 🔗 Learn More

For more details about Java basics and programming concepts, consider visiting online tutorials and resources dedicated to Java programming. Practice is key to mastering these skills.

---

Thank you for choosing JavaProgramming! Enjoy exploring the world of Java coding.
20 changes: 20 additions & 0 deletions Strings/ValidAnagram.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class ValidAnagram {
public boolean isAnagram(String s, String t) {

HashMap<Character,Integer> h1 = new HashMap();
HashMap<Character,Integer> h2 = new HashMap();

for(int i=0;i<s.length();i++)
{
h1.put(s.charAt(i),h1.getOrDefault(s.charAt(i),0)+1);
}

for(int i=0;i<t.length();i++)
{
h2.put(t.charAt(i),h2.getOrDefault(t.charAt(i),0)+1);
}

return h1.equals(h2);

}
}