public static void main(String[] args) {
System.out.println((Integer.valueOf("5000") <= Integer.valueOf("5000")));
System.out.println((Integer.valueOf("5000") == Integer.valueOf("5000")));
}
Run Code Online (Sandbox Code Playgroud)
上面的代码分别打印true和false。这是可以理解的,但是为什么false当我们使用==.
但是,当使用<=(小于或等于)时,为什么是答案true?