我在编译时遇到问题,它是一个“意外类型的必需变量;找到:值”和“不兼容的类型”我的代码在这里:
`
String sCL;
BufferedReader br = null;
br = new BufferedReader(new FileReader("banned.txt"));
providerSocket = new ServerSocket(2004, 10);
connection = providerSocket.accept();
`
while((sCL = br.readLine()) != null) {
if ((br.readLine()) = (connection.getInetAddress().getHostName())) {
sendMessage("baned");
}
else {
//some code here.
}
}
错误在.readLine()
和.getHostName()