Computing.Net > Forums > Programming > The outer while loop did not executed

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

The outer while loop did not executed

Reply to Message Icon

Name: mazz
Date: October 8, 2009 at 21:30:33 Pacific
OS: Microsoft Windows XP Professional
CPU/Ram: 3.189 GHz / 1013 MB
Product: Dell / OPTIPLEX 745
Subcategory: Java
Comment:

Tell me why the outer loop did not executed after inner loop finish. If there is another solution for this please advise.


while ((strLine = br.readLine()) != null)

{

while ((strLine1 = br1.readLine())!= null)
{
if (!strLine.equals(strLine1))
{
System.out.println("ouput");
output.write(strLine);
output.write(newline);
}

else

{
System.out.println("constraint");
output.write("constraint");
output.write(newline);
}
}

output.close();
}



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: October 9, 2009 at 01:47:57 Pacific
Reply:

Perhaps because br only has one line?


0

Response Number 2
Name: nbrane
Date: October 11, 2009 at 20:38:21 Pacific
Reply:

maybe output close needs to be outside the brackets of
the outer loop?

output.close();
}

instead maybe:
}
output.close()


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: The outer while loop did not executed

While loop failure www.computing.net/answers/programming/while-loop-failure/6825.html

Nested for loops to seperate data www.computing.net/answers/programming/nested-for-loops-to-seperate-data/19438.html

do while loops www.computing.net/answers/programming/do-while-loops/11374.html