Page 1 of 1

Introduction to Arrays From declaration to common control structures Rate Topic: ***** 4 Votes

#1 TriggaMike  Icon User is offline

  • Using up all your 1's and 0's
  • member icon

Reputation: 85
  • View blog
  • Posts: 1,103
  • Joined: 26-September 08

Post icon  Posted 30 January 2009 - 12:08 AM

*
POPULAR

Arrays can be complicated, and they can also be very powerful. What is an Array? Why should you use it?
What are the benefits?

In this tutorial I will do a line by line walk through of both syntax of Arrays, and commonly used
code with arrays. It will answer the above questions, and it also contains examples, fully commented so you
can compile and run them so see the results.

********************************Terminology*************************************

Array
An array is a data structure that can hold multiple elements and can be used to index through the
contents of the data. I will not go into the actual structure and what goes on behind the scenes in
this tutorial.

Element
This is what you generally call the contents of the data blocks that you create when you make
an array. They can be referred to as many different things, but for the purposes of this tutorial I
will be referring to them as elements.

Index
This is how you control where you read/write to your array. For example array[x] x would
be known as the index. When you are using a for loop or other loop structure to easily read/write to large
arrays, this is known as indexing through the array. IMPORTANT: Array indexes range from 0
as the first position, to one less than the array length. For example, declaring new array[5]
will have valid indexes of 0 to 4.

Dimension
The Dimension of an array is simply how many sets of [] you have. As you have more dimensions,
how you deal with arrays becomes equally more complicated.


These definitions may seem a little vague now, but the rest of the tutorial will explain in more detail.


*********************************Declaration************************************

First Let's Start with Declaration:

/**
 * @author Mike Magnus
 */
public class ArrayTutorial
{
	public static void main(String[] args)
	{
		
		/* ***************************
		 * PART 1: Declaring Arrays **
		 * ***************************
		 */
		
		
		/* METHOD 1
		 * Here I will declare an int array.
		 * You could do this with any data type, simple or complex
		 * 
		 * All the elements of this array are initialized to 0 by default
		 */
		int[] array = new int[5];
		System.out.print(array[0] + "\n");
		
		
		/* METHOD 2
		 * This way provides initial values for the arrays
		 */
		int[] array2 = {1,2,3,4,5};
		System.out.print(array2[0] + "\n");
		System.out.print(array2[1] + "\n");
		System.out.print(array2[2] + "\n");
		System.out.print(array2[3] + "\n");
		System.out.print(array2[4] + "\n");
		
		
		/* METHOD 3
		 * Similar to method 1, but some people prefer this
		 */
		final int SIZE = 5;
		int[] array3 = new int[SIZE];
	}
}



Let's Take a closer look at the Method 1 declaration and break it down:

int[]
This tells Java that you would now like to make a reference to an array.
This does NOT create the array, in English this would say "I would like to hold the address*
of an array."



*When talking about anything other than primitive data types (eg. int, char, double, etc.) the variables
you declare are not actually holding data, but they are holding memory addresses. Just remember that
you cannot use these addresses without telling Java to make something and then store the address
in your variable. Don't worry about what this actually stores, think of it just like a regular address,
it allows your program to find things.




array
Notice that there are not square brackets beside this. Right now array is ready to
hold the address of where the array will actually be in your memory.



= new int[5];
This statement does a number of things. The statement tells Java that you would like to make a new
array of int with 5 elements. To remember this, it should look identical to the first statement,
except now you are required to specify the number of elements you want your array to have, because you
are now telling Java to build your array. You must specify the number of elements or you WILL get
a compiler error.




NOTE
When initializing arrays like this, for int arrays they will be initialized with 0 in all the
elements. Depending on the array type the initial contents may vary, so never depend on the
initialization.


Let's now take a quick look at Method 2:

int[] array2 = {1,2,3,4,5};
Here instead of directly telling Java to make an array using the
new keyword, we are submitting a set of numbers that then creates the array and initializes it.
So with this declaration you choose what elements are initialized to, and Java sets the array size depending
on that.



{1,2,3,4,5}
Here you will see that the number set is surrounded by braces, and the elements are
separated by commas. The size of this array will correspond to how many elements you include in the braces.
This declaration has 5 elements.


Let's take a quick look at Method 3 for declaring Arrays:

int[] array3 = new int[SIZE];
Now the only real difference is that I used a constant variable to set the size of the variable.
This is a very common practice and you will likely see this quite often.


Now if you haven't already, compile and run this code and see exactly what is output.


**************************************Assigning Values**********************************

The second part of this tutorial goes through the different ways that you can assign values
to elements:

/**
 * @author Mike Magnus
 */
public class ArrayTutorial2
{
	public static void main(String[] args)
	{
		
		int[] array = new int[5];
		
		int[] array2 = {1,2,3,4,5};
		
		final int SIZE = 5;
		int[] array3 = new int[SIZE];
		
		
		/* ********************************
		 * PART 2: Simple Array Handling **
		 * ********************************
		 */
		
		
		/* EXAMPLE 1
		 * Simple Number Input.
		 */
		
		array[0] = 5; //Assign the first element to be 5
		array[1] = 4; //Assign the second element to be 4
		array[2] = 3; //Etc.
		array[3] = 2;
		array[4] = 1;
		
		System.out.print(array[0] + " " + array[1] + " " + array[2] + " " + 
				array[3] + " " + array[4] + "\n");
		
		
		
		/* EXAMPLE 2
		 * Using a For Loop
		 */
		
		int cnt = 0; //I'll explain the reasoning for this
		for(cnt = 0; cnt < array2.length; cnt++) //Pay Attention Here too
		{
			array2[cnt] = cnt; //With the cnt variable I am now indexing through the array
			System.out.print(array2[cnt] + "\n");
		}
		
		
		
		/* EXMAPLE 3
		 * Reversing the For Loop
		 */
		
		//Since cnt has already been declared I can't declare it again
		for(cnt = (array3.length - 1); cnt >= 0; cnt--) //Look at what exactly I did here
		{
			//Change the value of an array element
			array3[cnt] = cnt;
			
			//Print the result
			System.out.print(array3[cnt] + "\n");
		}
		
	}
}



Here I have given three examples of primitive ways of assigning values to elements.
EXAMPLE 1:
		array[0] = 5; //Assign the first element to be 5
		array[1] = 4; //Assign the second element to be 4
		array[2] = 3; //Etc.
		array[3] = 2;
		array[4] = 1;

This shows the most primitive and time consuming method of assigning values. Essentially you can
hard code the index position, and what value you would like to have there. You should notice that
this would cause problems if your array has 100's, or 1000's of elements, in which case we move onto
Example 2.


EXAMPLE 2:
		int cnt = 0;
		for(cnt = 0; cnt < array2.length; cnt++)
		{
			array2[cnt] = cnt;
			System.out.print(array2[cnt] + "\n");
		}

This chunk is a little more complicated, so I'll break it down.


int cnt = 0;
I declare this outside of the for loop header because it is actually more memory and processor efficient.
When dealing with arrays at multiple positions in a program it can also prevent confusion related to
variable scope*. Essentially this will make your program run more efficiently,
and it will also prevent you from declaring ONE variable TWICE, which would cause a compiler error.


for(cnt = 0; cnt < array2.length; cnt++)
This is the most common header you will see with Arrays. If anything sticks here, let this be it.
Although it isn't necessary, it is a good habit to have to always have cnt = 0 in the for loop
header (but more preferably the name of the variable you are using to index).
It functions as a guarantee that you are starting to index from the first position.
Let's break this down further:


cnt < array2.length
This introduces a new concept, the array.length. Notice there ARE NOT any () after
length. This is because it is a variable, NOT a method. It returns the size of the array, but
the .length of the array is actually one higher than you can use as an index. This is
why our test uses < instead of <=. Your index should NEVER BE HIGHER THAN ONE LOWER
THAN THE LENGTH.



cnt++
This causes the variable cnt to be increased by 1 at the end of every iteration.


array2[cnt] = cnt;
Here is why we use for loops. We use the cnt value as an index. The for loop is set up to
ensure that we get all the data in the array without indexing outside of the array. Now this
piece of code will do the following:
Set the element at position cnt to the value of 5 - cnt as the value of cnt increasing by
one with the index value.


Now as a whole, this chunk of code takes the array array2, assigns different values
to all of it's elements, and prints them out as they are assigned. This is because it shows
both functions of this type of for loop, writing AND reading from arrays. Now let's move onto
Example 3.


EXAMPLE 3:
for(cnt = array3.length; cnt >= 0; cnt--)
We are only looking at the header for this loop, because all the other components are exactly the same
as example 2.


cnt = (array3.length - 1)
In this example, instead of starting at 0 and indexing up to one less than the length,
I am now doing the exact opposite. This piece sets the index variable to ONE LESS THAN THE LENGTH.
This is very important, because if you did this cnt = array3.length you would get an error.


cnt >= 0
The condition is making sure that you index up to and including zero. So it will read true until
the for loop has indexed through the entire array.


cnt--
Simple operation that decreases the value of cnt by one at the end of every loop.
Same as cnt = cnt - 1 .

Remember to compile and run the code on your own computer to see the results, and then you can
tie that to what piece of code was responsible for the message.



*********************************Two Dimension Arrays*******************************

This third part of the tutorial covers the basics of Two Dimensional Arrays. What is a two dimensional Array?


Two Dimensional Arrays are arrays that have two indexes. To help understand them,
A two dimensional array is typically thought of to look like a table. Generally the first index is called
row and the second index is called col short for column.


/**
 * @author Mike Magnus
 */
public class ArrayTutorial3
{
	public static void main(String[] args)
	{
		/* *********************************
		 * Part 3: Multi-Dimension Arrays **
		 * *********************************
		 */
		
		/* Method 1
		 * Static Rows and Columns
		 */
		int[][] array = new int[5][6];
		
		/* Method 2
		 * Initializing to create
		 */
		int[][] array2 = {{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}};
		
		/* Method 3
		 * Ragged Arrays
		 */
		int[][] array3 = new int[5][];
		
		/* Example 1
		 * Writing with 2d arrays
		 */
		int row = 0; //The first index
		int col = 0; //The second index
		for(row = 0; row < array.length; row++) //For loop to deal with rows
		{
			for(col = 0; col < array[row].length; col++) //For loop to deal with columns
			{
				//Accesses the element at row, col, and stores the value of those two numbers multiplied.
				array[row][col] = row*col;
			}
		}
		
		/* Example 2
		 * Reading with 2d Arrays and a common problem
		 */
		for(row = 0; row < array2.length; row++)
		{
			//THE NEXT FOR LOOP IS AN ERROR, BUT IT WILL STILL RUN
			for(col = 0; col < array2[0].length; col++) //This line has something that may or may not cause an error
			{
				//Using Printf allows easy formatting without using number formatters
				System.out.printf("%2d ",array2[row][col]);
			}
			//Usually you will add new lines in this for loop
			System.out.print("\n");
		}
		
		/* Example 3
		 * Making a ragged array
		 */
		for(row = 0; row < array3.length; row++)
		{
			array3[row] = new int[row + 1];
		}
		
		/* Example 4
		 * Dealing with the danger of ragged arrays
		 * and Ragged Array Structure
		 */
		for(row = 0; row <array3.length; row++)
		{
			//This is how you should always do the nested for loop
			for(col = 0; col < array3[row].length; col++)
			{
				System.out.print(array3[row][col] + " ");
			}
			System.out.print("\n");
		}
	}
}


As with before, I will break down all the new components of the code above.

Let's take a look at Method 1 for declaring two dimensional arrays:

int[][] array = new int[5][6];
So here we see the only real difference is that we are defining an int[][]. This is because
how ever many sets of [] determines the number of dimensions, as mentioned earlier.
Let's take a closer look at the array creation itself and what it means.

int[5][6];
This is saying that we want an array with 5 rows and 6 columns. So how much data can this
array store? The number of elements can be determined by multiplying row * col. In this example
we have a total of 30 elements. Now, this type of declaration is not the only way to create two
dimensional arrays.


Let's take a look at Method 2:

int[][] array2 = {{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}};
This doesn't seem a lot different from the first example of this declaration type.
Pay attention to the number of braces, and the number of commas. The actual size of this array
would 4 rows and 4 columns. This gives a hint to the actual structure of two dimension,
and any multi-dimension array.


Now let's jump to Method 3:

int[][] array3 = new int[5][];
No, this is not an error. How can I do this?? Well, I can do this is because of what a two dimensional
actually array is. A two dimensional array is actually an array of arrays. So when we doing this it is
only necessary to declare the size of the highest level array. This gives us the ability to create
what are known as ragged arrays, or arrays with variable length rows. This will be shown more clearly in
the examples.


Now that you are familliar with the different methods to declaring two dimensional arrays, let's look
at operations handling these array structures.

Example 1:
		int row = 0; //The first index
		int col = 0; //The second index
		for(row = 0; row < array.length; row++) //For loop to deal with rows
		{
			for(col = 0; col < array[row].length; col++) //For loop to deal with columns
			{
				//Accesses the element at row, col, and stores the value of those two numbers multiplied.
				array[row][col] = row*col;
			}
		}

So once again we see here that I am declaring my index variables here, outside of the for loops.
The first for loop has exactly the same header as last time, but now we have a nested for loop.
This is the key to dealing with two dimensional, and multi-dimensional arrays, you will almost
always need as many for loops as you have dimensions. Let's take a close look at the difference
in the nested for loop.

col < array[row].length
Now why would I do this instead of just array.length? Because as I said previously, not all rows
need to be the same length, and there probably will not be equal number of rows and columns. But why
couldn't you just do array[0].length? In this example I could, but getting into that habit would cause
problems, and that leads into example 2.


Example 2:
		for(row = 0; row < array2.length; row++)
		{
			//THE NEXT FOR LOOP IS AN ERROR, BUT IT WILL STILL RUN
			for(col = 0; col < array2[0].length; col++) //This line has something that may or may not cause an error
			{
				//Using Printf allows easy formatting without using number formatters
				System.out.printf("%2d ",array2[row][col]);
			}
			//Usually you will add new lines in this for loop
			System.out.print("\n");
		}

This chunk of code looks very similar, except we are now reading from an array. I have also
included a style error here. This code will compile and run properly, but any changes would likely
cause an error. This is because of the following statement.

col < array2[0].length
So this does work, in this case. Do not get into a habit of doing this, because likely at some point
you may deal with ragged arrays and this will cause errors in those cases. When doing this always use the
higher level index variable, such as row to get the length of the column.

System.out.printf("%2d ",array2[row][col]);
This is not a printf tutorial, but essentially I use this just to format the number input to be right
justified and have one space between values printed on the same row.

System.out.print("\n");
This appears inside the first loop because this will essentially construct the table look in a command prompt.
Using a simple read block like this will lay out your array data in a very easy to read format.


Example 3:
for(row = 0; row < array3.length; row++)
		{
			array3[row] = new int[row + 1];
		}

This example is shearly to show how you can declare the size of the second dimension when dealing with
a ragged array. This shows the concept of array of arrays in a functioning context.

array3[row] = new int[row + 1];
Here you can see I am actually telling the program to store an array at array3[row].
I am telling it to make a new array, and I give it a varied size of row + 1.
This is what makes a ragged array uniquely functional, but also open to easy runtime errors.
Remember to always do what I showed you in this first and last examples. They second example is exactly the
kind of thing that crashes you at random points.

		for(row = 0; row <array3.length; row++)
		{
			//This is how you should always do the nested for loop
			for(col = 0; col < array3[row].length; col++)
			{
				System.out.print(array3[row][col] + " ");
			}
			System.out.print("\n");
		}

This is some serious code here. This is what you really want to stick to when dealing with any arrays. It's
that safest against errors and it's virtually the same length of code. Use smarter programming practices
and you will be a better programmer.

Let's break this block down a bit too.

for(col = 0; col < array3[row].length; col++)
Just to reinforce the importance of your nested for loop looking like this when reading and writing to any
two dimensional array algorithms.

				System.out.print(array3[row][col] + " ");
			}
			System.out.print("\n");
		}

This is just a fun little simple way to draw out an array so to speak. There are plenty of creative ways
you can use a two dimensional array to draw a neat looking table of numbers and letters, and you can even use
further nester statements to tweak the print out even more. You can get some really neat results when you
try to play around with tweaking some code, changing numbers for characters, and then have more complicated
things like entire strings, or even eventually cross word puzzles. Thats just how complex these things can
eventually get. That why you want to keep your code good and clean when your learning to code, because it
will make you more valuable in your profession as a programmer.


**********************************Conslusion*******************************

Arrays
Structures that may be of variable length through code. You may have an array of
any datatype. Any object, any primitive datatype, in fact, even an array itself.
In Java you can have as many array dimensions as you want. There is no limit in java
so if you want to have 1,000,000 dimension array you could
, but I would also reccomending have 32GB of ram
to start up java and store all those arrays.

For Loops
Most important control structure in relation to arrays. Helps both with looping and indexing directly, making
it ideal for the task at hand. Remember the two headers we had:

for(row = 0; row < array3.length ; row++)

and

for(col = 0; col < array3[row].length ; col++)

And for multi-dimensional arrays, all you do is keep nesting more variables inside of more for loops that
look identical to the second example, except it has another index location. That is really all you
need to know about the basics of dealing with arrays of almost any number of dimensions.

Thank you for reading, and I hope this tutorial was clear enough to help you from knowing the declartions of
arrays to knowing how to read and write to single, and multi-dimensional arrays.

Is This A Good Question/Topic? 6
  • +

Replies To: Introduction to Arrays

#2 sgp4316  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-February 09

Posted 28 February 2009 - 02:48 AM

:^: :) Thanks for the tutorial. Learning to sore stings in an array
would be the next tutorial that would help immensely.
Thanks, {:>
Was This Post Helpful? 0
  • +
  • -

#3 sherry47  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-March 09

Posted 18 March 2009 - 11:44 PM

What is the format for doing two dimensional Arrays using char I wrote a private variable instance and it is coming up with an error message saying can not find variable A
[ ] private char [] [] rotor1={{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z},
{G,T,U,B,Z,Y,V,J,L,K,S,A,W,X,H,C,D,E,M,N,O,P,Q,R,I,F}};
private char [] [] rotor2 ={{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z},
{L,C,D,G,Y,U,B,Z,S,V,J,E,M,A,W,X,H,N,O,P,Q,R,I,F,T,K}};
private char [] [] rotor3 ={{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z},
{S,V,J,E,M,W,X,L,N,A,B,H,C,O,P,Q,R,I,F,Y,D,G,T,U,Z,K}};
private char [] [] reflector ={{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z},
{Y,R,U,H,Q,S,L,D,P,X,N,G,O,K,M,I,E,B,F,Z,C,W,V,J,A,T}}; []
Was This Post Helpful? 0
  • +
  • -

#4 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 521
  • View blog
  • Posts: 5,596
  • Joined: 20-March 08

Posted 06 July 2009 - 06:40 PM

View Postsherry47, on 19 Mar, 2009 - 12:44 AM, said:

What is the format for doing two dimensional Arrays using char I wrote a private variable instance and it is coming up with an error message saying can not find variable A


(although this person posted in March, I'll answer just to let anyone else, that's having the same problem, get an answer)

You need to have 'A' instead of just A. Likewise with all of the other letters.

The reason for this being that if you don't use the quotation marks, the compiler thinks you're trying to use a variable called A. When you use the quotation marks, it lets the compiler know that it's a constant character, instead of a variable identifier.

Hope this answered your question! :)

This post has been edited by Locke: 06 July 2009 - 06:42 PM

Was This Post Helpful? 0
  • +
  • -

#5 erietha  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 59
  • Joined: 26-July 09

Posted 29 August 2009 - 08:12 PM

View PostLocke, on 6 Jul, 2009 - 05:40 PM, said:

View Postsherry47, on 19 Mar, 2009 - 12:44 AM, said:

What is the format for doing two dimensional Arrays using char I wrote a private variable instance and it is coming up with an error message saying can not find variable A


(although this person posted in March, I'll answer just to let anyone else, that's having the same problem, get an answer)

You need to have 'A' instead of just A. Likewise with all of the other letters.

The reason for this being that if you don't use the quotation marks, the compiler thinks you're trying to use a variable called A. When you use the quotation marks, it lets the compiler know that it's a constant character, instead of a variable identifier.

Hope this answered your question! :)


Good tutorial..
final int ROWS = 12;

final int COLS = 12;

final static int topLeftNum[][]= {
	{-1, 1, 0, 2, 0, 0, 3, -1, 4, 0, 5, 0},
	{6, 0, 0, 0, -1, -1, 0, -1, -1, -1, 0, -1},
	{-1, 0, -1, 0, -1, 7, 0, 0, 8, -1, 0, -1},
	{9, 0, 0, 0, 10, -1, -1, -1, 11, 0, 0, -1},
	{0, -1, -1, 12, 0, 0, 13, -1, 0, -1, -1, -1},
	{0, -1, 14, -1, 0, -1, 0, -1, 15, 0, 0, 16},
	};

for (int j=0; j<COLS; j++) {
	for (int i=0; i<ROWS; i++)	{
//String numstr = String.valueOf(topLeftNum[i][j]);
this.getContentPane().add(new Box(i, //the boxes index

(topLeftNum[j][i] < 0) ? Color.BLACK : Color.WHITE, //pick the color

topLeftNum[j][i], //the topleft number

(char)(65+i), //the char inside

this), //the action listener for the button

i); //the index to place it on the container

}
}



I have problems with 2D array of JButton.. I make crossword grid with it and managed to put the array topLeftNum[][] on the top left of JButton but the number is in wrong side..
Instead of like this
	{-1, 1, 0, 2, 0, 0, 3, -1, 4, 0, 5, 0},
	{6, 0, 0, 0, -1, -1, 0, -1, -1, -1, 0, -1},
	{-1, 0, -1, 0, -1, 7, 0, 0, 8, -1, 0, -1},
	{9, 0, 0, 0, 10, -1, -1, -1, 11, 0, 0, -1},
	{0, -1, -1, 12, 0, 0, 13, -1, 0, -1, -1, -1},
	{0, -1, 14, -1, 0, -1, 0, -1, 15, 0, 0, 16},
 

I got it like this ((it's become upside down)) . How to solve this problem?
  {0, -1, 14, -1, 0, -1, 0, -1, 15, 0, 0, 16},
  {0, -1, -1, 12, 0, 0, 13, -1, 0, -1, -1, -1},
  {9, 0, 0, 0, 10, -1, -1, -1, 11, 0, 0, -1},
  {-1, 0, -1, 0, -1, 7, 0, 0, 8, -1, 0, -1},
  {6, 0, 0, 0, -1, -1, 0, -1, -1, -1, 0, -1},
  {-1, 1, 0, 2, 0, 0, 3, -1, 4, 0, 5, 0},


This post has been edited by erietha: 29 August 2009 - 08:17 PM

Was This Post Helpful? 0
  • +
  • -

#6 TriggaMike  Icon User is offline

  • Using up all your 1's and 0's
  • member icon

Reputation: 85
  • View blog
  • Posts: 1,103
  • Joined: 26-September 08

Posted 28 September 2009 - 01:46 PM

Thanks for all the positive comments guys!


Just a reminder if you would like help with your problems and they are not covered by this tutorial or this tutorial has not helped you solve your problem, please post them in the Java programming help forum!
Was This Post Helpful? 0
  • +
  • -

#7 majid90  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 23-October 10

Posted 18 April 2011 - 09:31 PM

View PostTriggaMike, on 28 September 2009 - 01:46 PM, said:

Thanks for all the positive comments guys!


Just a reminder if you would like help with your problems and they are not covered by this tutorial or this tutorial has not helped you solve your problem, please post them in the Java programming help forum!


mr if i save set of data like a phonebook in array how do search back the number that being save and display it back the set of data
Was This Post Helpful? 0
  • +
  • -

#8 skystealer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-July 13

Posted 12 July 2013 - 12:14 PM

I was looking through this and (I'm currently running arrays in functions using var because int doesn't work) I didn't see anything about arrays in functions using var. Do you have a separate tutorial for this?
Was This Post Helpful? 0
  • +
  • -

#9 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10646
  • View blog
  • Posts: 39,536
  • Joined: 27-December 08

Posted 12 July 2013 - 12:19 PM

The var keyword doesn't exist in Java. Are you working in Javascript?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1