题目内容

以下关于静态成员的说法不正确的是

A. 静态成员属于类,被这个类的所有实例所共享
B. 常量会隐式地声明为静态成员
C. 所有使用static修饰的成员都是静态成员
D. 所有没有使用static修饰的成员都是实例成员

查看答案
更多问题

阅读以下程序public class Count{static int count;int number;public Count(){count = count + 1;number = count;}}class Test{public static void Main(){Count a = new Count();Count b = new Count();Count c = new Count();}}程序运行后,对象a的count值是()

A. 0
B. 1
C. 2
D. 3

class Test{int x;static int y;static void Main(){Test t = new Test();t.x = 1;t.y = 1;test.x = 1;test.y = 1;}}以上程序中共有几句错误()

A. 1
B. 2
C. 3
D. 4

以下关于this的说法不正确的是()

A. 在类的实例构造函数中,关键字this表示当前的类实例或对象的引用。
B. 在类的实例函数成员中,关键字this表示当前的类实例或对象的引用。
C. 关键字this不能用在静态构造函数中。
D. 关键字this能用在静态函数成员中。

阅读以下程序class A{public static int x;static A(){ x = B.y + 1;}}class B{public static int y = A.x + 1;static B(){}static void Main(){Console.Write(“{0},{1}”,A.x,B.y);}}以上程序运行后的输出结果是()

A. 2,1
B. 1,1
C. 1,2
D. 2,2

答案查题题库