更多"对于下面程序,对p调用正确的是( )。 class A publ"的相关试题:
[单项选择]对于下面程序,对p调用正确的是( )。
class A
public:fun(int i)cout<<i<<endl;
;
main( )
A a;
int k=0;
void(A::*p)(int);
p=A::fun;
A. p(k);
B. *a.p(k)
C. *p(k)
D. a::*p(k)
[单项选择]对于下面程序,对p调用正确的是( )。 class A{ public:fun(int i){cout<<i<<endl;} }; main( ){ A a; int k=0; void(A::*p)(int); p=A::fun; }
A. p(;
B. *p(
C. *p(
D. a::*p(
[单项选择]对于下面程序,对p进行赋值正确的是( )。
class A
public:fun(int i)cout<<i<<endl;
;
main( )
void(A::*p)(int);
A. p=fun;
B. p=fun();
C. p=A::fun;
D. p=A::fun()
[单项选择]阅读下面的程序:
public class Person
int arr[ ]=Hew int[10];
public static void main(String args[ ])
System.out.println(arr[1]);
正确的说法是______。
A. 编译时将产生错误
B. 编译时正确,运行时将产生错误
C. 输出为0
D. 输出为空
[单项选择]下面程序执行后的输出结果为( )。 public class fun { public static void main(String args[]) { String greets="How are you!"; String s=greets.substring(0,3); System.out.println(S); } }
A. How
B. ar
C. you
D. how ate you!
[单项选择]有如下类定义:
class Fun
public:
Fun(int v):value(v)//①
~Fun( )//②
private:
Fun,//③
int value=0;//④
;
其中存在语法错误的行是( )。
A. ①
B. ②
C. ③
D. ④
[单项选择]有下列程序段
public class fun
public static void main(String args[])
char b[] = "Hello,you";
b[5] = 0;
System.out.println(s);
执行此程序后,得到的输出结果是( )。
A. Hello,you
B. Hello0you
C. Hello
D. 0
[单项选择]有下列程序段
public class fun
public static void main(String args[])
char b[]="Hello,you";
b[5] = 0;
System.out.println(s);
执行此程序后,得到的输出结果是( )。
A. Hello, you
B. Hello0you
C. Hello
D. 0
[单项选择]有下列程序段 public class fun { public static void main(String args[]) { char b[]="Hello,you"; b[5] = 0; System.out.println(s); } 执行此程序后,得到的输出结果是( )。
A. Hello, you
B. Hello0you
C. Hello
D. 0
[单项选择]阅读下面的程序: public class Person{ int arr[ ]=Hew int[10]; public static void main(String args[ ]){ System.out.println(arr[1]); } } 正确的说法是______。
A. 编译时将产生错误
B. 编译时正确,运行时将产生错误
C. 输出为0
D. 输出为空
[单项选择]给出下列的程序,其叙述正确的是( )。
public class Man
static int arr[]=new int[10];
public static void main(String args[])
System. out. println (arr[1=];
A. 编译时将发生错误
B. 编译时正确但是运行时出错
C. 输出为0
D. 输出为null
[单项选择]阅读下列代码后
public class Person
int arr[]=new int[10];
public static void main(String args[])
System.out.println(arr[1]);
正确的说法是
A. 编译时将产生错误
B. 编译时正确,运行时将产生错误
C. 输出零
D. 输出空
[单项选择]阅读下列代码后
public class Person
int arr[]=new int[10];
public static void main(String args[])
System.out.println(arr[1]);
正确的说法是( )。
A. 编译时将产生错误
B. 编译时正确,运行时将产生错误
C. 输出零
D. 输出空
[单项选择]有如下程序段: public class Parent { public int addValue (int a,int b) { int s; s=a+b; return 3; } } class Child extends Parent {} 则下列选项中,可以正确加入类Child中且父类的方法不会被覆盖的是( )。
A. int addValue (int a,int {//do somethin..}
B. public void addValue() {//do somethin..}
C. public int addValue (int a,int throws MyException {//do somethin..}
D. public float addValue (int a,int b,float b=1.0) {//do sometin..}
[单项选择]阅读下面程序
public class VariableUse
public static void main(String[] arqs)
int a;
if(a==8)
int b=9;
System.out.println("a="+
A. ;
B. ;