Skip to content

KhushiKalwani24/Arrays-in-Java

Repository files navigation

🧮 Arrays in Java

Java Arrays Animation


🌟 Overview

This repository contains simple and beginner-friendly Java programs based on Arrays.
It is designed to help students and beginners understand how arrays work in Java —
from declaration and initialization to more advanced operations like sorting, searching, and matrix handling.


📚 Topics Covered

  • Declaring and Initializing Arrays
  • Traversing Arrays
  • Finding Minimum and Maximum Elements
  • Sorting Arrays
  • Searching Elements (Linear & Binary Search)
  • Multi-dimensional Arrays (2D Arrays / Matrices)
  • Common Array Practice Problems

🧠 Objective

To provide clear, simple, and easy-to-understand examples that strengthen your understanding of array manipulation and logic building in Java.


⚙️ How to Run

1️⃣ Clone the repository

git clone https://github.com/<your-username>/Arrays-in-Java.git
cd Arrays-in-Java
2️⃣ Compile the Java file
bash
Copy code
javac FileName.java
3️⃣ Run the program
bash
Copy code
java FileName
💡 Example:

bash
Copy code
javac LinearSearch.java  
java LinearSearch
🪄 Example Program
java
Copy code
public class SumOfArray {
    public static void main(String[] args) {
        int[] arr = {10, 20, 30, 40, 50};
        int sum = 0;

        for (int num : arr) {
            sum += num;
        }

        System.out.println("Sum of array elements: " + sum);
    }
}
🧩 Folder Structure
markdown

💡 Future Additions
Reverse an array

Rotate an array

Remove duplicates

Dynamic input using Scanner

Interactive examples

🧑‍💻 Author
Khushi Kalwani
💬 “Learning Java, one array at a time!”

⭐ Contribute
Want to add your own array program?

Fork this repo 🍴

Add your file

Open a pull request 🚀

<p align="center"> Made with ❤️ and ☕ in Java </p> ```

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages