Given the following code, under which circumstances will the method return false?
public static boolean
test(InputStream is) throws IOExecption{
int value =is.read();
return value==(value& 0xff);
}
Select all valid answers.
A) a character of more than 8 bits was read from the stream
B) An I/O error occurred.
C) Never
D) The end of the input was reached in the input stream
Answer is D.
As far as I know, the end of the input stream when reached by read, is -1, so return will be
-1==(-1&-1) that will return true, am I right?
Thanks