摘要: 多态性 :分为静态多态和动态多态 1.静态多态 相同一个方法名 参数的数量或者类型不一样,这就是静态多态。 public int Getvlue(int x, int y) { return x + y; } public string Getvlue(string x, string y) { r 阅读全文
posted @ 2023-02-01 19:34 灰色淡季 阅读(21) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 值类型和引用类型 { /// <summary> 阅读全文
posted @ 2022-05-11 11:55 灰色淡季 阅读(53) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.Dynamic; using System.Reflection; using System.Reflection.Emit; public class TestClass { 阅读全文
posted @ 2021-12-18 13:45 灰色淡季 阅读(79) 评论(0) 推荐(0)
摘要: using System; using System.Reflection; using System.Reflection.Emit; using System.Windows.Forms; class ExampleForm : Form { public ExampleForm() : bas 阅读全文
posted @ 2021-12-17 15:37 灰色淡季 阅读(26) 评论(0) 推荐(0)
摘要: using System; namespace runoob { class Student { private string code = "N.A"; private string name = "not known"; private int age = 0; // 声明类型为 string 阅读全文
posted @ 2021-10-03 14:11 灰色淡季 阅读(40) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace 阅读全文
posted @ 2021-06-04 11:05 灰色淡季 阅读(68) 评论(0) 推荐(0)
摘要: 三种工厂模式: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace 简单 阅读全文
posted @ 2021-06-02 18:32 灰色淡季 阅读(53) 评论(0) 推荐(0)
摘要: abstract 抽象方法 virtual 可重写的抽象方法 override 实现抽象方法 阅读全文
posted @ 2021-06-01 17:37 灰色淡季 阅读(48) 评论(0) 推荐(0)
摘要: 这个用起来很爽,通常在不知道主窗体是谁,但是要做成 子窗体可以随时获取主窗体的值,如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using Sys 阅读全文
posted @ 2021-05-06 00:00 灰色淡季 阅读(346) 评论(0) 推荐(0)
摘要: 一个类中 一般包含: 构造函数:和类同名的方法 字段:公开变量 属性:供安全访问的变量(实例化这个类才能访问) 方法:执行一个东西 事件:被动发生的,可以传入一个方法进去 枚举:定义1234 阅读全文
posted @ 2021-04-21 15:09 灰色淡季 阅读(69) 评论(0) 推荐(0)