问题
Android Studio is telling me that there are some "Unexpected Tokens"..
what are these??
screenshots:
error in code
error in Messages
回答1:
You have invisible character in these lines, \8232 is line separator. Possibly you copied it somewhere.
Try to paste it in Notepad/TextEdit and copy text from there. Point is to get rid of formatting and extra characters. Or you can just delete these lines and retype them manually.
回答2:
private InputStream checkForUtf8BOMAndDiscardIfAny(InputStream inputStream) throws IOException {
PushbackInputStream pushbackInputStream = new PushbackInputStream(new
BufferedInputStream(inputStream), 3);
byte[] bom = new byte[3];
if (pushbackInputStream.read(bom) != -1) {
if (!(bom[0] == (byte) 0xEF && bom[1] == (byte) 0xBB && bom[2] == (byte) 0xBF)) {
pushbackInputStream.unread(bom);
}
}
return pushbackInputStream;
}
来源:https://stackoverflow.com/questions/33146115/what-does-an-unexpected-token-mean-and-can-i-solve-it