8
如果C允许,为什么Java完全不允许数字条件,如if(5){…}?
我有两个小程序: C #include <stdio.h> int main() { if (5) { printf("true\n"); } else { printf("false\n"); } return 0; } 爪哇 class type_system { public static void main(String args[]) { if (5) { System.out.println("true"); } else { System.out.println("false"); } } } 报告错误消息: type_system.java:4: error: incompatible types: int cannot be converted to …
33
java
c
type-systems