Welcome to the Webmaster Forum.
Results 1 to 9 of 9
  1. #1
    Senior Member
    Join Date
    Jan 2014
    Location
    Banglore
    Posts
    289

    Why are arrays usually processed with for loop?

    Arrays comes from their facility of using an index variable to traverse the array, accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable i serves as a counter, incrementing from 0 to a.length -1. That is exactly what a loop does.

  2. #2
    Senior Member
    Join Date
    Aug 2014
    Location
    India
    Posts
    183

    Re: Why are arrays usually processed with for loop?

    It is bassically using for traversing the index of array thats The Real power of arrays , Accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable a[i] serves as a counter, incrementing from 0 to a.length -1.

  3. #3
    Senior Member
    Join Date
    Aug 2014
    Location
    India, New Delhi
    Posts
    230

    Re: Why are arrays usually processed with for loop?

    The real power of arrays comes from their facility of using an index variable to traverse the array, accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable i serves as a counter, incrementing from 0 to a.length -1. That is exactly what a loop does.

  4. #4
    Member
    Join Date
    Oct 2017
    Posts
    59

    Re: Why are arrays usually processed with for loop?

    Because it's the simplest most logical way to do it. You can go through an array other ways but this is the most common.
    Get 100 Email validation tool Credits at Zero Bounce

  5. #5
    Senior Member
    Join Date
    Sep 2015
    Location
    jalandhar
    Posts
    596

    Re: Why are arrays usually processed with for loop?

    The real power of arrays comes from their facility of using an index variable to traverse the array, accessing each element with the same expression a[i].

  6. #6
    Senior Member
    Join Date
    Jan 2016
    Posts
    212

    Re: Why are arrays usually processed with for loop?

    ARRAY statements are common tools in the DATA step. Together they allow us to iteratively process large amounts of data with a minimum amount of code.

  7. #7
    Senior Member
    Join Date
    Sep 2015
    Location
    jalandhar
    Posts
    596

    Re: Why are arrays usually processed with for loop?

    ARRAY statements are common tools in the DATA step. Together they allow us to iteratively process large amounts of data with a minimum amount of code.

  8. #8
    Member
    Join Date
    Dec 2017
    Location
    Santa Clara, California, USA
    Posts
    81

    Re: Why are arrays usually processed with for loop?

    An array, in the context of Java, is a dynamically-created object that serves as a container to hold a constant number of values of the same type. By declaring an array, memory space is allocated for values of a particular type. At the time of creation, the length of the array must be specified and remains constant. That is exactly what a loop does.

  9. #9
    Junior Member
    Join Date
    Mar 2018
    Posts
    27

    Re: Why are arrays usually processed with for loop?

    Arrays are used to store multiple data of the same type in a contiguous memory location. Now to store these data in each index of the array or to do some useful work on them you need to traverse it i.e. go through each index in the array. for-loops are extensively used when working with arrays. To iterate through every value of the array.

 

 

Similar Threads

  1. What is a linklist and why do we use it when we have arrays?
    By chinmay.sahoo in forum Coding & Programming
    Replies: 0
    Last Post: 04-04-2016, 05:29 AM
  2. Replies: 3
    Last Post: 02-22-2016, 06:36 AM
  3. Sorting Arrays
    By chinmay.sahoo in forum PHP
    Replies: 4
    Last Post: 02-11-2016, 04:01 AM
  4. How PHP Files Are Processed
    By chinmay.sahoo in forum Coding & Programming
    Replies: 0
    Last Post: 12-18-2015, 12:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Back to top

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188