更多"阅读下列代码后 public class Person in"的相关试题:
[单项选择]阅读下列代码后
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[]);
正确的说法是( )。
A. 编译时将产生错误
B. 编译时正确,运行时将产生错误
C. 输出零
D. 输出空
[单项选择]有如下类定义:
class XX
int xdata;
public:
XX(int n=0):xdata(n)
;
class YY:public XX
int ydata;
public:
YY(int m=0,int n=0):XX(m),ydata(n)
;
YY类的对象包含的数据成员的个数是( )。
A. 1
B. 2
C. 3
D. 4
[单项选择]有如下类声明:
class XA
int X;
public:
XA(int n)x=n;
;
class XB:public XA
int y;
public:
XB(int a,int b);
;
在构造函数XB的下列定义中,正确的是( )。
A. XB::XB(inta,int b):x(a),y(b)
B. XB::XB(int a,int b):XA(a),y(b)
C. XB::XB(int a,int b):x(a),XB(b)
D. XB::XB(int a,int b):XA(a),XB(b)
[单项选择]设有定义:
Class person
int num;
char name[10];
public:
void init(int n,char*m);
…
;
person std[30]
则以下叙述不正确的是
A. std是一个含有30个元素的对象数组
B. std数组中的每个元素都是person类的对象
C. std数组中的每个元素都有自己的私有变量num和name
D. std数组中的每个元素都有各自的成员函数init
[单项选择]执行完代码int[]x=new int[25];后,以下说明正确的是( )。
A. x[24]为0
B. x[24]未定义
C. x[25]为0
D. x[0]为空
[单项选择]下列代码的执行结果是______。
int numbers[]=new int[6];
for(int i=1;i<numbers.length;i++)
numbers[i]=i-1;
System.out.print(numbers[i]+"");
A. 0 1 2 3 4 5
B. 1 2 3 4 5 6
C. 0 1 2 3 4
D. 1 2 3 4 5
[单项选择]设有定义语句int k[]=new int[3];,则下列对此语句的叙述中错误的是( )。
A. 定义了一个名为k的一维数组
B. k数组有3个元素
C. k数组元素的下标为1~3
D. 数组k中的每一个元素都是整型
[单项选择]类模板template<class T>class x…,其中,友元函数f对特定类型T(如int),使函数f(x<int>&=成为x<int>模板类的友元,则其说明为( )。
A. friend void f();
B. friend void f(x<T>&=;)
C. friend void A::f()
D. friend void C<T>::f(x<T>&=;)
[单项选择]已知int[]a=new int[100];,在下列给出的数组元素中,非法的是______。
A. a[0]
B. a[1]
C. a[99]
D. a[100]
[单项选择]若数组a定义为int[][]a=new int[3][4],则a是______。
A. 一维数组
B. 二维数组
C. 三维数组
D. 四维数组
[单项选择]有如下类定义:
class Foo public:
Foo(int v): value(v) // ①
~Foo( ) // ②
private:
Foo( ) ) // ③
int value =0; // ④
;
其中存在语法错误的行是( )
A. ①
B. ②
C. ③
D. ④
[单项选择]下列程序的输出结果是______。
int fun(int x,int y,int*cp,int*dp)
*cp=x+y; *dp=x-y;
main( )
int a, b, c, d;
a=30;b=50;
fun(a,b,&c,&d);
printf("%d,%d/n", c, d);
A. 50,30
B. 30,50
C. 80,-20
D. 80,20
[单项选择]
Text 1
Among the class of new CEOs at struggling European technology giants, none will be more intriguing to watch in 2003 than Deutsche Telekom’s Kai-Uwe Ricke. He shares almost nothing with his flashy and argumentative predecessor from Sony, Ron Sommer, who had always remained something of an outsider in the notoriously political company. The son of a former Telekom chief, Ricke is a born insider.
He inherits huge problems, including a huge debt load from years of splurging, a slow-growth business and a hierarchical company culture dating from when Telekom was an arm of the post office, a monolith with more staff than the German Army. For all Sommer’s talk about the New Economy, he built on the old tradition, controlling the company through a team of feared lieutenants. Sommer hired Ricke away from a competitor in 1998 to run the fast-growing conglomerate’s mobile-phone business. He soon came to see him as a potential successor and promo
A. inherited huge problems.
B. splurged the company asset.
C. tried out successful reforms.
D. regarded Ricke highly and helped him.