arrays - Use ArrayList to get value without using zero as first value - Java -


i need fix this.. calling array number, although next value in array because first 1 zero.

i using arraylist. there way call index value - 1 perhaps ?

here example:

for (int = 0; < questions.size(); i++)  {     output.write(string.valueof(page_words.get(questions.get(i-1))));     system.out.println(page_words.get(questions.get(i))); } 

see i-1, there way works?

no can't generate exception.

arraylist.get(int i) method of array list can take argument >=0 and<size() negative value generate indexoutofboundsexception.

so arraylistindex < 0 or arraylistindex >= size() indexoutofboundsexception generated.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -