在C#中,下列变量定义与赋值正确的是(选一项)
A: int age =12.5;
B: string name =ACCP;
C: double money =100.0;
D: char leel=A;
A: int age =12.5;
B: string name =ACCP;
C: double money =100.0;
D: char leel=A;
举一反三
- 在C#中,下列结构或者类定义正确的是(选一项) A: public struct Person{ string name; int age; public void ShowName(){ Console.WriteLine(name); }} B: public struct Person{ string name; int age; public Person(){ Conssole.WriteLine(name); }} C: public class Person{ string name; int age; public Person(){ Conssole.WriteLine(name); }} D: public class Person{ string name; int age; public Person(string name){ Conssole.WriteLine(name); }}
- 在C#中,下列变量定义与赋值正确的是(选一项)
- 在C#语言中定义了如下变量:char ch;下列赋值语句正确的是(选一项
- 下列( )方法定义和调用的代码是正确的。 A: static void Introduce(string gender = "男", string name, int age = 18){} Introduce(name: "alex", age: 20); B: static void Introduce(string name, int age = 18, string gender = "男"){} Introduce(age: 20, name: "alex"); C: static void Introduce(string gender = "男", string name, int ago = 18){} Introduce(age: 20, name: "alex"); D: static void Introduce(string name, int age = 18, string gender = "男"){}Introduce(name: "alex", age: 20);
- 有如下结构体类型和变量的定义,在C语法中如下赋值错误的是()。 struct info{ int no; double ave; char gender; char name[10]; }stu;