View Single Post
  #2 (permalink)  
Old 05-14-2008, 01:42 PM
rjuyal's Avatar
rjuyal rjuyal is offline
Senior Member
 
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
rjuyal is on a distinguished road
Code:
while(iter.hasNext() != false) { System.out.println("iter.hasNext() = " + iter.hasNext() +"......" +(i++)); System.out.println("iter.next() = " + iter.next()); field = (String)iter.next(); type = (String)list.get(iter.next()); } }
convert this to:

Code:
while(iter.hasNext()) { System.out.println("iter.hasNext() = " + iter.hasNext() +"......" +(i++)); field = (String)iter.next(); System.out.println("iter.next() = " + field); type = (String)list.get(field); } }
What mistake was in your code was, u checked whether iterator is having NextElem if yes then get next 3 elems , that is, probably, not what you wanted.
__________________
i am the future
Reply With Quote