Search:

Type: Posts; User: Norm

Search: Search took 0.40 seconds.

  1. Replies
    24
    Views
    1,281

    [SOLVED] Re: Not sure where my problem is

    Use 0 as the starting index when searching from the first element to the last
    Use theArray.length-1 as the starting index when searching from the last element to the first
  2. Replies
    24
    Views
    1,281

    [SOLVED] Re: Not sure where my problem is

    It's better to start at theArray.length-1. That will be the index to the last element in the array.

    It's better NOT to hardcode numbers like array lengths in a program.
  3. Replies
    24
    Views
    1,281

    [SOLVED] Re: Not sure where my problem is

    When iterating through an array with a standard for loop, it's better to use the array's .length field and not hard code the size of the array:


    for(int i=0; i<theArray.length; i++) {
Results 1 to 3 of 3