class Employee{ private string id; public string Id; ________________//请填写正确的代码行 { return id; } set{if(id. Length>;2) id = value;} }应填写的代码是
A: let
B: set
C: get
D: put
A: let
B: set
C: get
D: put
举一反三
- 请填写代码 public class Teacher { int age=33; private string name; public string Name { get{请在此处填上代码} set{请在此处填上代码} } } public void SaySomething{ //….. }
- 已知函数getStudent()定义为public Student getStudent(int ID),下列四个选项中可以与getStudent构成重载的方法是 A: private Student getStudent(int ID) B: public String getStudent(int ID) C: Student getStudent(String name) D: public Student get(int ID)
- 以下程序段哪段是正确的() A: declare id int default 0; repeat set id=id+1; end repeat;<br> until id>=10; B: declare id int default 0; repeat set id=id+1; end repeat;<br> until id>=10 C: declare id int default 0; repeat set id=id+1; until id>=10 end repeat; D: declare id int default 0; repeat set id=id+1; until id>=10; end repeat;
- 在以下代码中,( )是类Teacher的方法。 public class Teacher { int age=33; private string name; public string Name { get{return name;} set{name=value;} } public void SaySomething(){ //….. } }
- class Person{} class Student extends Person{ public int id; public int score; public String name; public int getScore() { return score; }