这是一个通用的问题,以帮助有程序问题的新程序员,但不知道如何使用调试器来诊断问题的原因.
这个问题涉及两类更具体的问题:
[What is a debugger and how can it help me diagnose problems?](https://stackoverflow.com/q/25385173)
我在处理应用程序时犯了编码错误,这是对null引用的测试.我花了几个小时来发现问题是什么,但我不明白的是为什么代码表现如此.
String name = null;
String value = null;
if(name != null && value != null);
{
System.out.println("Values not null");
}
Run Code Online (Sandbox Code Playgroud)
if语句结束了;,这是我的错误,Values not null即使很明显两个值都为空,也会打印出来.谁能解释为什么?