在以下代码中,( )是类Teacher的方法。 public class Teacher { int age=33; private string name; public string Name{ get{return name;} set{name=value;} } public void SaySomething(){ //….. }}
A: Name
B: name
C: age
D: SaySomething
A: Name
B: name
C: age
D: SaySomething
举一反三
- 在以下代码中,( )是类Teacher的方法。 public class Teacher { int age=33; private string name; public string Name { get{return name;} set{name=value;} } public void SaySomething(){ //….. } }
- 在下列C# 代码中,( )是类Teacher 的属性。 Public class Teacher{ int age=13; private string Name{ get{return name;} set{name=value;} } public void SaySomething(){//…} } A: Name B: name C: age D: SaySomething
- 在c#代码中,_______是类Teacher的属性。public class Teacher{ int age=13; private string Name{ get{return name;} set{return name;} } public void SaySomething(){ //… }} A: name B: Name C: age D: SaySomething
- 请填写代码 public class Teacher { int age=33; private string name; public string Name { get{请在此处填上代码} set{请在此处填上代码} } } public void SaySomething{ //….. }
- 在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); }}