下列语句错误的是______
A: int val(20);
B: exterm int val(20);
C: const int val;
D: extern const int val;
A: int val(20);
B: exterm int val(20);
C: const int val;
D: extern const int val;
举一反三
- 给定以下代码:interface I { void setValue(int val); int getValue(); }以下哪段代码能编译? A: interface A implements I { void increment(); } B: class A extends I { void increment(); } C: abstract class C implements I { int value; public void setValue(int val) { value = val; } public int getValue() { return value; } } D: class A extends I { int value; void setValue(int val) { value = val; } int getValue() { return value; } }
- 给定以下代码:interface I { void setValue(int val); int getValue(); }以下哪段代码能编译? A: class A extends I { void increment(); } B: abstract class C implements I { int value; public void setValue(int val) { value = val; } public int getValue() { return value; } } C: class A extends I { int value; void setValue(int val) { value = val; } int getValue() { return value; }} D: interface A implements I { void increment(); }
- 以下哪个方法是正确的? A: public static int Sum(int n, params int[] val){ int count = 0; foreach (int a in val){ count = count + a; } return count + n;} B: public static int Sum(params int[] val, int n){ int count = 0; foreach (int a in val){ count = count + a; } return count + n;} C: public static int Sum(params int[] v1, params int[] v2){ int c1 = 0, c2 = 0; foreach (int a in v1){ c1 = c1 + a; } foreach (int a in v2){ c2 = c2 + a; } return c1 + c2;} D: public static int Sum(params int[] v, char ch){ int c = 0; foreach (int a in v){ c = c + a; } return c + ch;}
- 表达式 Chr$(Int(Val("66.39abc"))) 的值是()
- 以下代码中可完成数字加1操作的是 A: valfunc=(x:Int)=>x+1 valfunc=(x:Int)=>x+1 valfunc=(x:Int)=>x+1 valfunc=(x:Int)=>x+1 valfunc=(x:Int)=>x+1val func=(x:Int)=>x+1 B: valfunc=(x)=>x+1 valfunc=(x)=>x+1 valfunc=(x)=>x+1 val func=(x)=>x+1 C: valfunc2=(_:Int)+1 val func2=(_:Int)+1 D: val func2=_+1