while(s=bf.readLine()!=nul)l | SoloLearn: Learn to code for FREE!



why it is showing error? String can't be converted to boolean and vice versa

5/19/2017 9:43:54 AM

Somnath Ghosh

1 Answer

New Answer


I think you might be trying to do a bit too much at once. I believe that assignment statements return a Boolean value. (which is why you need to be careful with the number of equal signs (x=42) will always be true, while (x==42) will respond to your other calculations) So I'd do the readline() first, then go into the loop, that should fix that right up.