更多"对于下面程序,对p进行赋值正确的是( )。 class A pu"的相关试题:
[单项选择]对于下面程序,对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)
[单项选择]阅读下面的程序:
public class Person
int arr[]=new int[10];
public static void main(String args[])
System.out.println(arr[1]);
正确的说法是______。
A. 编译时将产生错误
B. 编译时正确,运行时将产生错误
C. 输出为0
D. 输出为空
[单项选择]阅读下面的程序:
public class Person
int arr[ ]=Hew int[10];
public static void main(String args[ ])
System.out.println(arr[1]);
正确的说法是______。
A. 编译时将产生错误
B. 编译时正确,运行时将产生错误
C. 输出为0
D. 输出为空
[单项选择]有如下类定义:
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 Person
int art[]=new int[10];
public static void main(String args[])
System.out.println(arr[1]);
正确的说法是( )。
A. 编译时将产生错误
B. 编译时正确,运行时将产生错误
C. 输出零
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 VariableUse
public static void main(String[] arqs)
int a;
if(a==8)
int b=9;
System.out.println("a="+
A. ;
B. ;
[单项选择]阅读下面代码
public class Person
static int arr[]=new int[10];
public static void main(String args)
System.out.println(arr[9]);
该代码的运行结果是