类MyClass中,下列哪条语句定义了一个只读的属性Count?(3分)
A. private int Count;
B. private int count; public int Count{ get{return count;} }
C. public readonly int Count;
D. public readonly int Count { get{ return count;} set{count = value;} }
查看答案
classClass1{publicstaticintCount=0;staticClass1(){Count++;}publicClass1(){Count++;}}Class1o1=newClass1();Class1o2=newClass1();请问,Class1.Count的值是多少?()(2分)
A. 1
B. 3
C. 2
D. 4
整型数组MyIntArray的定义和初始化如下。为了将数组MyIntArray的所有元素值写入FileStream流,可创建_______类的实例对该流进行写入。int[]MyIntArray=newint[400];for(inti=0;i〈400;i++)MyIntArray=i;(2分)
A. BinaryWriter
B. StreamWriter
C. TextWriter
D. StringWriter
在C#程序中,可以使用_______属性来引用处于非托管代码环境中的函数。(2分)
A. "[DllImport]"
B. "[Conditional]"
C. "[STAThread]"
D. "[SecureMethod]"
如果要将窗体设置为透明的,则()(2分)
A. 要将FormBoderStyle属性设置为None;
B. 要将Opacity属性设置为小于100%得值;
C. 要将locked 属性设置为True;
D. 要将 Enabled属性设置为True;