阅读以下程序public class Shape{private string comments;protected string name;public string Name{ get{ return name;} set{name = value;}}public Shape(){}public Shape(string name){}public void Draw() {}}public class Rectangle:Shape{protected int width;protected int height;public int Width{get{return width;} set{width=value;}}public int Height{get{return height;} set{height=value;}}public Rectangle(){}public Rectangle(int cx,int cy){}public int ComputeArea(){}}以上Shape类中的成员没有被Rectangle类继承的是()
A. comments
B. name
C. Name
D. 构造函数
查看答案
阅读以下程序public class Shape{private string comments;protected string name;public string Name{ get{ return name;} set{name = value;}}public Shape(){}public Shape(string name){}public void Draw() {}}public class Rectangle:Shape{protected int width;protected int height;public int Width{get{return width;} set{width=value;}}public int Height{get{return height;} set{height=value;}}public Rectangle(){}public Rectangle(int cx,int cy){}public int ComputeArea(){}}以上在Rectangle类的ComputeArea中不可访问的是()
A. name
B. comments
C. Draw()
D. Width
阅读以下程序public class Shape{private string comments;protected string name;public string Name{ get{ return name;} set{name = value;}}public Shape(){}public Shape(string name){}public void Draw() {}}public class Rectangle:Shape{protected int width;protected int height;public int Width{get{return width;} set{width=value;}}public int Height{get{return height;} set{height=value;}}public Rectangle(){}public Rectangle(int cx,int cy){}public int ComputeArea(){}public void Print(){Console.WriteLine(name);//Line:1Console.WriteLine(Name);//Line:2Console.WriteLine(comments); //Line:3Draw();//Line:4}}以上程序中错误的是()
A. Line:1
B. Line:2
C. Line:3
D. Line:4
以下关于继承说法不正确的是()
A. 子类能在继承基类的基础上添加新的成员。
B. 子类能移除从基类中继承成员的定义。
C. 类的继承是可传递的。
D. 类不能循环继承。
以下关于继承的说法不正确的是()
A. 类的直接基类必须具有至少和类本身同样的可访问性。
B. 在C
C. 中只支持单一继承。
D. 在C
E. 中可以实现多个接口。
F. 可以将基类隐式地转换到它的派生类。