Jump to content

Can someone help me with basic array


Recommended Posts

Posted

"ind" is your indice number, the array[ i ], i means the position in the array which accompanies an element in the array.

 

Say you have:

int array[] = { 9, 8, 7, 6};

and then you type array[0] it will return the number 9 in the array list.

Maybe this will help you visualize easier:

 

Array+in+Java+Comparision.gif

Posted (edited)

for(int i = 0; i < arrays.length; i++){
 //Here is where I mean
}

Creates a loop that'll keep looping whilst the value of i is less than the length of the Array arrays.

In this case you're declaring a loop that initialises a value of i that starts at zero.

i++ means after each loop it'll increase the value of i by 1.

in the case of array, i is the index in the array defined above.

so on the first loop array would be 1, on the second loop 23, ect.

Although I have no idea what ind is or what kind of tutorials you're following.

Maybe someone else can clear that up

 

Oh I didn't read the full thing 0.0 I see why it has heaps of underscores now xD

 

Edited by Isolate

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...