March 2015 | VirtualSpecies

This website uses cookies to ensure you get the best experience. More info...

Best Programmer Joke _ int page[1];

1. Definition 
Programmer Shirt

Java Array

We know that variables are used to store data in a Java program. We also know that each variable can store not more than one data item. So, what do we do if we need to store a large number of data items, say 50. Well, we can use 50 variables, one for each of the 50 data items, but we need to write 50 lines of code for setting up these variables, or we can use ARRAYs. Which will need just a single line. Most real-world programs handle vast amount of data. An array with loops can relatively handle a vast amount of data.

An array is an object that is used to store a list of values, all of which have the same data type (Check Two Dimensional Array for complex data type). An array is a reference data type just like class. It is made of an attached block of memory. This memory space is also divided by CELLs, which hold a value. Sometimes the cells of an array are called SLOTs. Below is a picture of an array.
Array Elements
Array Elements