1.假设有如下程序:
public class Demo {
public static void main(String args[]) {
int num = 2147483647 ;
num += 2 ;
System.out.println(num) ;
}
}
最终的执行结果是什么?
A -2147483648
B 2147483649
C -2147483647
D 2
2.下面那种类型不属于Java的基本数据类型?
A byte
B .nt
C boolean
D String
3.假设有如下程序:
public class Demo {
public static void main(String args[]) {
int x = 10 ;
double y = 20.2 ;
long z = 10L;
String str = "" + x + y * z ;
System.out.println(str) ;
}
}
最终执行结果是什么?
A 10202.0
B 0212.0
C 302.0
D 1020.210
4.假设有如下程序:
public class Demo {
public static void main(String args[]) {
boolean flag = 10%2 == 1 && 10 / 3 == 0 && 1 / 0 == 0