我在Java中遇到了一个声明
while ((line = reader.readLine()) != null) {
out.append(line);
}
Run Code Online (Sandbox Code Playgroud)
赋值操作如何在Java中返回值?
我们正在检查的声明是line = reader.readLine(),我们将其与之进行比较null.
既然readLine会返回一个字符串,我们究竟要检查的是null什么?
我在Zookeeper和代理身份验证上启用SASL时遇到以下错误.
[2017-04-18 15:54:10,476] DEBUG Size of client SASL token: 0
(org.apache.zookeeper.server.ZooKeeperServer)
[2017-04-18 15:54:10,476] ERROR cnxn.saslServer is null: cnxn object did not initialize its saslServer properly. (org.apache.zookeeper.server. ZooKeeperServer)
[2017-04-18 15:54:10,478] ERROR SASL authentication failed using login context 'Client'. (org.apache.zookeeper.client.ZooKeeperSaslClient)
[2017-04-18 15:54:10,478] DEBUG Received event: WatchedEvent state:AuthFailed type:None path:null (org.I0Itec.zkclient.ZkClient)
[2017-04-18 15:54:10,478] INFO zookeeper state changed (AuthFailed) (org.I0Itec.zkclient.ZkClient)
[2017-04-18 15:54:10,478] DEBUG Leaving process event (org.I0Itec.zkclient.ZkClient)
[2017-04-18 15:54:10,478] DEBUG Closing ZkClient... (org.I0Itec.zkclient.ZkClient)
[2017-04-18 15:54:10,478] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
[2017-04-18 15:54:10,478] DEBUG …Run Code Online (Sandbox Code Playgroud) void exampleFunction(int a, int b)
{
int c=sum(multiply(a,b),c);
}
Run Code Online (Sandbox Code Playgroud)
在调试这个exampleFunction时,有没有办法可以在运行时检查乘法(a,b)函数的返回值.我不想放任何System.out.println语句.在android studio中调试代码时建议一种方法.