昨日翻译
“ I'd like to run away from you. But if you didn't come and find me...I would die.”
—— Shirley Bassey
“我想逃离你。但如果你不来找我…我会死的。”
——莎丽·贝希
“ I love thee, I love but thee With a love that shall not die Till the sun grows cold And the stars grow old. ”
——William Shakespeare
2019.07.15问题及解析
public class Test {
static int arr[] = new int[3];
public static void main(String[] args) {
System.out.println(arr[0]);
}
}
下列说法正确的是?
A.编译错误
B.运行错误
C.输出0
D.输出null
当数组作为静态成员时,初始化之后具有默认值
默认值与数组存储的额基本数据类型默认值一致
如int[]数组则默认值为0
代码编译正常,运行正常
该静态成员数组元素的默认值为0
答案选C。
2019.07.16问题
选择语句——switch
在java7中,不能作为switch()语句的参数的是?
A.浮点型
B.字符型
C.枚举型
D.int型