This repository contains simple Java programs that demonstrate various operations on arrays.
SumofArray.java→ Program to find the sum of all elements in an array.MaxiumSubarray.java→ Program to find the maximum subarray (Kadane’s Algorithm).ArrayExample.java→ Example array operations.Main.java→ Main test class.
Enter the size of an array: 5 Enter the elements of an array: Element 1: 10 Element 2: 20 Element 3: 30 Element 4: 40 Element 5: 50
Array elements are: 10 20 30 40 50
Sum of all elements in the array = 150
-
Clone this repo:
git clone https://github.com/Abhaysoni100/Java-Array-Project.git
-
Navigate to the src folder: cd Java-Array-Project/src
-
Compile and run: javac SumofArray.java java SumofArray