摘要:
{ public class Employee1 { private string name; public string Name { get { return name; } set { name = value; } } } public class Manager : Employee1 { private string name; // Notice the use of the new... 阅读全文
摘要:
当我们要引用一个属性(对其进行读取的时候)调用get访问器以读取属性值class Person{ private string name; // the name field public string Name // the Name property { get { return name; } }}person ps=new person();console.write(ps.Name);此... 阅读全文
摘要:
今天在作题目的是的时候突然想到这个问题 class TimePeriod { private double seconds; public virtual double Hours { get { return seconds / 3600; } set { seconds = value * 3600;} } } class TimePer : TimePeriod { } class Pro... 阅读全文
摘要:
当一个类实现一个接口的方法如下: publick Interface ShoutOf { void On(); void Off(); } publick class Door:ShoutOf { publick void Off() { console.writeline("灯关拉"); } publi... 阅读全文