📄 class1.cs
字号:
using System;
using System.IO;
namespace chapter3
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
// #region 对象创建
// Person p= new Person("mei",18,3303);
// p.
// p.display();
// #endregion
// #region 静态成员
// Student s1= new Student(12);
//
// Student s2= new Student (20);
// s1.display();
// s2.display();
// #endregion
// #region 构造函数
// Complex c= new Complex(3.1,4.2);
//
// Console.WriteLine("main program running");
// #endregion
// #region swap
// int x=10,y=20;
// Console.WriteLine("x={0},y={1}",x,y);
// TestValue.Swap(ref x,ref y);
// Console.WriteLine("x={0},y={1}",x,y);
// #endregion
// #region out1
// int t=65,r;
// char m;
// r=TestOut.OutMultiValue(t,out m);
// Console.WriteLine("r={0},m={1}",r,m);
// #endregion
// #region testparams
// int[] arr={10,20,30};
// TestParams.MutiParams(arr);
// TestParams.MutiParams(100,20);
// TestParams.MutiParams();
//#endregion
// #region point
// Point a= new Point(10,20);
// Point b=new Point(30,40);
// a=a+b;
// a.Display();
// a++;
// a.Display();
// #endregion
// #region Property
// Window y= new Window();
// y.width=200;
// Console.WriteLine("The width of window is {0}.",y.width);
// #endregion
// #region inherit
// Employee1 e=new Employee1("mei",10,255,"cs",4000);
// e.display();
// #endregion
// #region polymorphism
// Base b= new Base();
// Sun d= new Sun();
// b.Print();
// d.Print();
//
// b.Display();
// d.Display();
//
// b=d;
// b.Print();
// d.Print();
// b.Display();
// d.Display();
// #endregion
// #region testAbstract
// Square s=new Square(20,30);
// Circle c=new Circle(10);
// s.Area();
// c.Area();
//#endregion
// #region testdelegate
//TimeDelegate a= new TimeDelegate(MyTime.HelloTime);
// Console.WriteLine("Invoking delegate a:");
// a("A");
// TimeDelegate b=new TimeDelegate(MyTime.GoodbyeTieme);
// Console.WriteLine("Invoking delegate b:");
// b("B");
// TimeDelegate c=a+b;
// Console.WriteLine("Invoking delegate c:");
// c("C");
// c-=a;
// Console.WriteLine("Invoking delegate c:");
// c("C");
// MyTime t= new MyTime();
// TimeDelegate d= new TimeDelegate(t.SayTime);
// Console.WriteLine("Invoking delegate d:");
// d("D");
// #endregion
#region event
ProcessTime p= new ProcessTime();
MyTime1 t= new MyTime1();
//t.Timer +=new TimeEventHandler(p.GenerateTime);
t.OnTimer("Peter");
#endregion
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -