java - System.out.print .. printing not in order -


i'm using system.out.print print arraylist (cl), code looks this:

system.out.print("returning  \n"); for(int = 0 ; <cl.size(); i++){     if(i+1 == cl.size())         system.out.print(cl.get(i));     else         system.out.print(cl.get(i)+" ,"); } 

the output should like:

returning 1,2,3....

but shows this:

0 ,5 ,6 returning

edit: problem not in order of elements, in "returning" position.

i'm using windows 8 operations system , netbeans ide. why?!

in order have output returning 1,2,3.... first arraylist cl should contains numbers 1,2... , on second try use system.out.println("returning ");


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -