Learn **Java Arrays** from scratch with ease.
The topics listed below will enhance your array programming to
a great extent. Every topic improves your logic and makes you more keen to
go for next. Every example has been illustrated in a simple and conceptual
way. A rich variety of examples have been included which a user can
download.

**Introduction to Java Arrays**In this section you will be introduced to the concept of Arrays in Java Programming language. You will learn how the Array class in java helps the programmer to organize the same type of data into easily manageable format.

**Structure of Java Arrays**Now lets study the structure of Arrays in java. Array is the most widely used data structure in java. It can contain multiple values of the same type. Moreover, arrays are always of fixed length i.e. the length of an array cannot be increased or decreased.

**Java Array Declaration**As we declare a variable in Java, An Array variable is declared the same way. Array variable has a type and a valid Java identifier

**Java Array Initialization**After the declaration of an array variable, memory is allocated to it. The "new" operator is used for the allocation of memory to objects.

**Java Array Usage**We have already discussed that to refer an element within an array, we use the [] operator. The [] operator takes an "int" operand and returns the element at that index. We also know that the array indices start with zero, so the first element will be held by the 0 index.

**Copying Arrays**After learning all about arrays, there is still one interesting thing left to learn i.e. copying arrays. It means to copy data from one array to another.

**Two Dimensional Array**Two-dimensional arrays are defined as " an array of arrays". Since an array type is a first-class Java type, we can have an array of ints, etc.

**Multi Dimensional Array**So far we have studied about the one-dimensional and two-dimensional arrays. To store data in more dimensions a multi-dimensional array is used. A multi-dimensional array of dimension n is a collection of items.

**Sorting Algorithms**

**Bubble Sorting Algorithm**In this example we are going to sort integer values of an array using bubble sort.

**Bi-directional Bubble Sort In Java**A alternative of bubble sort is bi-directional bubble sort. The bi-directional bubble sort compares each adjacent pair of elements in an array.

**Heap Sort Algorithm In Java**In this example we are going to sort integer values of an array using heap sort. There are two types of heap. First one is Max heap and second one is min heap.

**Insertion Sort Algorithm In Java**Insertion sorting algorithm is similar to bubble sort. But insertion sort is more efficient than bubble sort because in insertion sort the elements comparisons are less as compare to bubble sort.

**Merge Sort Algorithm In Java**In merge sorting algorithm unsorted values are divided into two equal parts iteratively. Then merge both parts and sort it. Then again merge the next part and sort it.

**Extra Storage Merge Sort in Java**In extra storage merge sorting algorithm the unsorted values divide into two equal parts iteratively and create an array for store data value in extra storage.

**Odd Even Transposition Sort In Java**In this example we are going to sort integer values of an array using odd even transposition sort. Odd even transposition sort is a parallel sorting algorithm. Odd Even is based on the Bubble Sort technique.

**Quick Sort Algorithm In Java**Quick sort algorithm is developed by C. A. R. Hoare. Quick sort is a comparison sort. The working of quick sort algorithm is depending on a divide-and-conquer strategy.

**Selection Sort Algorithm In Java**

In this example we are going to sort the values of an array using selection sort. In selection sorting algorithm, find the minimum value in the array then swap it first position.

**Java Array****Convert****ArrayList****to***Array***Convert****Array****to***ArrayList*

Advertisements

Posted on: May 28, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms. Connect Me on Google+

Comments:10

May 27, 2011

any one who can help me with array philosophy

Thanx 4 te above!!!

August 15, 2011

:)

I want a sample program source code on how to make a java usinng arrays

August 27, 2011

array programs

i want to know more examples on two dimensional arrays like examples on matrix addition,print only the elements of the diagonal of a matrix,to print howmany elements in th matrix are 0,to print the elements of upper diognal of a matrix.

September 7, 2011

java

how can learn more in java

September 21, 2011

very nice and good tutorial

please provide more excamples of 1d sorting ..

September 24, 2011

Array

declaration of the array

November 9, 2011

java

java tutorials

January 24, 2012

java swapping

how can i swap 5 numbers using java sorting?

October 9, 2012

programming

java of the program

April 5, 2013

Thanks to RoseIndia.Net

It's much useful to Every Body

Discuss: Java Arrays TutorialView All Comments