Home Java Beginners Arrayexamples Java Arrays Tutorial
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Java Arrays Tutorial

Advertisement
Learn Java Arrays from scratch with ease. The topics listed below will enhance your array programming to a great extent.

Java Arrays Tutorial

     

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.

  1. 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. 
      
  2. 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.
      
  3. 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
      
  4. 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.
      
  5. 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.
      
  6. 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.
      
  7. 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.
      
  8. 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

  1. Bubble Sorting Algorithm
    In this example we are going to sort integer values of an array using bubble sort.
      
  2. 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.
  3. 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.
     
  4. 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.
      
  5. 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.
      
  6. 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.
     
  7. 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.
      
  8. 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.
      
  9. 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.
      
  10. Java Array

  11. Convert ArrayList to Array

  12. Convert Array to ArrayList

Java Beginners Tutorial.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  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.

Posted on: May 28, 2007

Ask Questions?    Discuss: Java Arrays Tutorial   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
Lefutso
May 27, 2011
any one who can help me with array philosophy

Thanx 4 te above!!!
Nes Ramos
August 15, 2011
:)

I want a sample program source code on how to make a java usinng arrays
kusum sorout
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.
mamad
September 7, 2011
java

how can learn more in java
http://www.infun2.blogspot.com
September 21, 2011
very nice and good tutorial

please provide more excamples of 1d sorting ..
Sanjay Kumar
September 24, 2011
Array

declaration of the array
sharath
November 9, 2011
java

java tutorials
yani
January 24, 2012
java swapping

how can i swap 5 numbers using java sorting?
jaymart
October 9, 2012
programming

java of the program
Nandhakumar Appavu
April 5, 2013
Thanks to RoseIndia.Net

It's much useful to Every Body
DMCA.com