override(C# 参考)
要扩展或修改继承的方法、属性、索引器或事件的抽象实现或虚实现,必须使用override 修饰符。
abstract class ShapesClass { abstract public int Area(); } class Square : ShapesClass { int side = 0; public Square(int n) { side = n; } // Area method is required to avoid // a compile-time error. public override int Area() { return side * side; } static void Main() { Square sq = new Square(12); Console.WriteLine("Area of the square = {0}", sq.Area()); } interface I { void M(); } abstract class C : I { public abstract void M(); } } // Output: Area of the square = 144
对日期的操作格式
string dtCheckNow = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), dtToday = System.DateTime.Now.ToString("yyyy-MM-dd"), dtTemorrow = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");