| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Michael Nischt wrote:
On Dec 1, 2006, at 2:49 AM, email@hidden wrote:
> Is there enough overhead (primarily referring to time) with finding > the length of an array, such that in a long loop you would want to > read the length once and store it in a variable for future reads > rather than reading the length from the array itself over and over > again? > > I'm just asking because this is true in some other languages, and > I'm new to Java.
I'm not a pro in this area, but AFAIK bounds checks are eliminated by hotspot in the followign case
for(int i=0; i<array.length; i++){ .. }
_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.