View Single Post
  #1 (permalink)  
Old 01-02-2008, 10:53 AM
ravian ravian is offline
Senior Member
 
Join Date: Nov 2007
Posts: 115
ravian is on a distinguished road
Indexing starting with 1
Indexing in Java starts with 0.

I am working in an application where I need it to start with 1. I know this can be done by subtracting 1 simply. For instance, if I want to fetch the 3rd item, it will be:

Code:
array[3-1];
Is there some pattern for this? I mean whats is the best way of achieving this.
Reply With Quote
Sponsored Links