设有如下代码class ArrayTest{public static vo...n(x[4]);}}哪个叙述为真?
输出 5
举一反三
- 设有如下代码public class Test{long a[] = new... a[6] );}}哪个叙述为真?
- 中国大学MOOC: 设有如下代码public class Test{ static int x[] = new int[10]; public static void main ( String arg[] ) { System.out.println(x[0]); }}哪个叙述为真?
- 中国大学MOOC: public class ArrayTest{ public static void main ( String args[] ) { String s[] = new String[5]; System.out.println(s[0]); }}哪个叙述为真?
- 设有如下代码public class Test{ static int x[] = new int[10]; public static void main ( String arg[] ) { System.out.println(x[0]); }}哪个叙述为真? A: 运行出错 B: 出现编译错误 C: 输出 0 D: 输出 null
- 有如下代码: public class Test{ public static ... 'C'; } } 运行后输出的结果是:
内容
- 0
public class ArrayTest{ public static void main ( String args[] ) { String s[] = new String[5]; System.out.println(s[0]); }}哪个叙述为真? A: 运行出错 B: 输出 0 C: 输出 null D: 出现编译错误
- 1
设有如下代码: class Base{} public class MyCast...e处插入哪个代码将不出现编译和运行错误。
- 2
设有如下程序,其调试结果为: class Q2 { public static ...t(' '+seeds[i]); } }
- 3
以下代码的输出结果 ? public class Test1{ static int x = 3; static { ++x; } public static void main(String args[]){ System.out.println(x); } static { x++; } }
- 4
对于如下代码,下列哪个叙述是正确的? public class E{ public static void main(String[] args){ String strOne="bird"; String strTwo=strOne; strOne="fly"; System.out.println(strTwo); } }