asynchronous - Does Java not do things asynchronously? -
I am trying to learn Java, I was reading a tutorial that said something like this:
< Pre> while (N & lt; = 0) {TextIO.put ("starting point should be positive, please try again:"); N = TextIO.getlnInt (); }
It seems that when you ask the user for input, it is not suspended until the response is received? I am getting asynchronous for these things. Is this normal for Java? Or can you both?
Thank you.
I'm not aware that TextIO
is the library, but when calling, i.e. < When using the code> System.in.read () , this block will make it synchronous until input data is available.
You can avoid this by using the second thread to capture the input (like make asynchronous).
Comments
Post a Comment