网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
在C#中,static不能修饰const定义的常量。
参考答案和解析
const能定义全局变量和局部变量
更多 “在C#中,static不能修饰const定义的常量。” 相关考题
考题
有如下类定义:class Test{public:Test(){ a = 0; c = 0;} // ①int f(int a)const{this-a = a;} // ②static int g(){return a;} // ③void h(intB . {Test::b = b;}; // ④private:int a;static int b;const int c;};int Test::b = 0;在标注号码的行中,能被正确编译的是A . ①B . ②C . ③D . ④
考题
在VB中,以下关于符号常量的声明正确的是 ( )A.Const TAG as StringB.Const TAG as String=&qu
在VB中,以下关于符号常量的声明正确的是 ( )A.Const TAG as StringB.Const TAG as String="Visual Basic"C.Public TAG as String="Visual"D.Dim TAG as String
考题
有如下类定义: class Test { public: Test(){a=0;c=0} //① int f(int a)const{this->a=a;} //② static int g(){return a;} //③ void h(int b){Test::b;}; //④ private: int a; static int b; const int C; }; int Test::b=0; 在标注号码的行中,能被正确编译的是( )。A.①B.②C.③D.④
考题
对于语句const int x=10;的描述正确的是( )。A.该语句不允许定义为int const x=10;B.在程序中可以重新对X赋值C.变量X不能使用+ +运算符D.const关键字只能用来修饰常量
考题
下列属于定义VB常量的语句是()。A、Dim常量名[As数据类型]=表达式B、Function常量名As数据类型C、Const常量名[As数据类型]=表达式D、Const常量名[As数据类型]
考题
下列关于const限定符的说法中,错误的是()。A、const限定符是左结合的,即它修饰在它左边的类型B、在说明const变量时,必须对该变量进行初始化C、与宏定义符号常量的区别是,const将产生一个具有类型的符号D、const变量是常量变量,所以一个const变量可以被多次赋予不同的常量
考题
在下列的标识符常量的定义语句中,错误的定义语句是()。A、const double PI=3.14159;B、const int N=20;C、const char ch;D、const bool mark=true;
考题
以下定义常量不正确的语句是()A、Const Num As Integer=200B、Const Num1 As Long=200, Sstr$="World"C、Const Sstr$="World"D、Const Num$=#World#
考题
代码public static const int A=1;中的错误是()A、 A需要定义类型B、 格式错误C、 const不能用static修饰符D、 const不能用public修饰符
考题
单选题代码public static const int A=1;中的错误是()A
A需要定义类型B
格式错误C
const不能用static修饰符D
const不能用public修饰符
考题
单选题下列关于const限定符的说法中,错误的是()。A
const限定符是左结合的,即它修饰在它左边的类型B
在说明const变量时,必须对该变量进行初始化C
与宏定义符号常量的区别是,const将产生一个具有类型的符号D
const变量是常量变量,所以一个const变量可以被多次赋予不同的常量
考题
判断题在Java的方法中定义一个常量要用const关键字。A
对B
错
热门标签
最新试卷