Answer the question
In order to leave comments, you need to log in
Why is the code not being executed after the while loop?
I run the code under the debugger:
import java.io.*;
public class Program {
public static void main(String[] args) throws IOException {
char[] buf;
buf = new char[9];
BufferedInputStream bf = new BufferedInputStream(System.in);
try{
int i, j, el;
j = bf.available();
char c;
while(((i = bf.read()) != -1) & j > 0) {
c = (char) i;
j = bf.available();
buf[j] = c;
}
el = Integer.parseInt(String.copyValueOf(buf));
System.out.println(el);
}
finally{
bf.close();
}
}
}
el = Integer.parseInt(String.copyValueOf(buf));
el = Integer.parseInt(String.copyValueOf(buf));
System.out.println(el);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question