• Post Reply Bookmark Topic Watch Topic
  • New Topic

for loop problem  RSS feed

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problems with a for loop. This for loop is nested within some other for loop. the problem I'm having is that the for loop executes once and then exits to execute the outer for loop. my initial reaction was that my condition (in the for loop ) was false the second time round thus resulting in the exit. I'm usually told to paste some code so i'll do that:
[code]
...
for (int i=0; i<row.size(); ++i){
for (int all = 1; all < row.size();all++){
try{
for (int k=0; k< column.size(); k++){System.out.println(" column size " + column.size());
Long longObject1 = (Long)((Vector)row.get(i)).get(k); System.out.println(" getting" + longObject1); }...
}
...
[code]

for (int k=0; k< column.size(); k++){ is the loop causing me problems. column.size() evaluates to 2 so what is the problem?
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't cross post. This is also in beginners.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!