Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 05 Aug 2011 12:39:05 -0500 Date: Fri, 05 Aug 2011 10:39:09 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: looping through a list, starting at 1 References: <6c7f77ed-569f-47b0-a83a-931e4fa7a544@e7g2000vbw.googlegroups.com> In-Reply-To: <6c7f77ed-569f-47b0-a83a-931e4fa7a544@e7g2000vbw.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <5pydnY7yVuQkt6HTnZ2dnUVZ_rudnZ2d@earthlink.com> Lines: 16 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.200.54 X-Trace: sv3-f14bR8cDYsl1COqzv2kvqHgK8BYQT3MFQxxy+1eUMp/Q+xVpe9V0exIzeH/1mS9UshLGutjJhCsW5NS!L5sEjaJZzqhuJkjZknYSQfywpsKbJPzPjUBNsl0fjqTfjSEgW+S4Lnz8HMFMy/8KLSw/tuLC2/Sp!PdYKKqqkFhV60Nosh25QlcWumDnmfb4+fDosrKjnYqv7Pg== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1786 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6810 On 8/5/2011 2:11 AM, Raymond Tong wrote: > It depends on the implmentation of list. It shouldn't. > If the list implements RandomAccess interface, it is recommended to > call get(i) instead of using iterator(). Why? I'm dealing right now with some code that followed that advice, so that changes will be needed throughout the code to change the choice of List implementation. The only reason random access is needed is because of code that could have used iterator(), but didn't. Patricia