Skip to content

Abhaysoni100/Java-Array-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Array Project

This repository contains simple Java programs that demonstrate various operations on arrays.

Programs Included

  • 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.

Example: Sum of Array Elements

Input

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

Output

Array elements are: 10 20 30 40 50

Sum of all elements in the array = 150

How to Run

  1. Clone this repo:

    git clone https://github.com/Abhaysoni100/Java-Array-Project.git
  2. Navigate to the src folder: cd Java-Array-Project/src

  3. Compile and run: javac SumofArray.java java SumofArray

About

Array methods

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages