diff --git a/C#进阶/C#进阶.sln b/C#进阶/C#进阶.sln
index 057b2ec..45feda1 100644
--- a/C#进阶/C#进阶.sln
+++ b/C#进阶/C#进阶.sln
@@ -21,6 +21,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lesson4_Hashtable", "Lesson
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lesson4_Hashtable练习题", "Lesson4_Hashtable练习题\Lesson4_Hashtable练习题.csproj", "{962C9536-7CD7-4F5A-9D1E-1DCF986953D4}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lesson5_泛型", "Lesson5_泛型\Lesson5_泛型.csproj", "{8ECE6977-E08D-4089-9053-DFFD9864AB81}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lesson5_泛型练习", "Lesson5_泛型练习\Lesson5_泛型练习.csproj", "{524E1BC4-FE9A-4186-B7EE-A04323E98696}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -63,6 +67,14 @@ Global
{962C9536-7CD7-4F5A-9D1E-1DCF986953D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{962C9536-7CD7-4F5A-9D1E-1DCF986953D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{962C9536-7CD7-4F5A-9D1E-1DCF986953D4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8ECE6977-E08D-4089-9053-DFFD9864AB81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8ECE6977-E08D-4089-9053-DFFD9864AB81}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8ECE6977-E08D-4089-9053-DFFD9864AB81}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8ECE6977-E08D-4089-9053-DFFD9864AB81}.Release|Any CPU.Build.0 = Release|Any CPU
+ {524E1BC4-FE9A-4186-B7EE-A04323E98696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {524E1BC4-FE9A-4186-B7EE-A04323E98696}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {524E1BC4-FE9A-4186-B7EE-A04323E98696}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {524E1BC4-FE9A-4186-B7EE-A04323E98696}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/C#进阶/Lesson5_泛型/Lesson5_泛型.csproj b/C#进阶/Lesson5_泛型/Lesson5_泛型.csproj
new file mode 100644
index 0000000..2150e37
--- /dev/null
+++ b/C#进阶/Lesson5_泛型/Lesson5_泛型.csproj
@@ -0,0 +1,10 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/C#进阶/Lesson5_泛型/Program.cs b/C#进阶/Lesson5_泛型/Program.cs
new file mode 100644
index 0000000..e0d530f
--- /dev/null
+++ b/C#进阶/Lesson5_泛型/Program.cs
@@ -0,0 +1,136 @@
+using System.Runtime.InteropServices;
+using static System.Net.Mime.MediaTypeNames;
+
+namespace Lesson5_泛型
+{
+ #region 知识点一 泛型是什么
+ //泛型实现了类型参数化,达到了代码重用的目的
+ //通过类型参数化来实现同一份代码上操作多种类型
+
+ //泛型相当于类型占位符
+ //定义类或方法时使用替代符代表变量类型
+ //当真正使用类或方法时再具体指定类型
+ #endregion
+
+ #region 知识点二 泛型分类
+ //泛型类和泛型接口
+ //基本语法:
+ //class 类名<泛型占位符>
+ //interface 接口名<泛型占位符>
+
+ //泛型占位语法
+ //基本语法:函数名<泛型占位符>(参数列表)
+
+ //注意:泛型占位符可以有多个,用逗号分开
+ #endregion
+
+ #region 知识点三 泛型类和接口
+ class Test
+ {
+ public T value;
+ }
+
+ class Test2
+ {
+ public T1 value1;
+ public T2 value2;
+ public K value3;
+ public M value4;
+ public L value5;
+ }
+
+ interface TestInterface
+ {
+ T value
+ {
+ get
+ {
+ return value;
+ }
+ set
+ {
+ this.value = value;
+ }
+ }
+ }
+
+ class Test4 : TestInterface
+ {
+ //接口实现
+ }
+ #endregion
+
+ #region 知识点四 泛型方法
+ class Test5
+ {
+ public void TestFun(T value)
+ {
+ Console.WriteLine(value);
+ }
+ public void TestFun()
+ {
+ //用泛型类型做逻辑处理
+ T t = default(T);//
+ }
+
+ public T TestFun(string v)
+ {
+ return default(T);
+ }
+
+ public void TestFun(T t,K k,M m)
+ {
+
+ }
+ }
+ class Test5//泛型类和普通类即使只是多加一个泛型也是两个类
+ {
+ public T value;
+
+ //下面这个不是泛型方法,因为T是泛型类声明时指定的
+ //我们就不能再手动指定类型了
+ public void TestFun(T t)
+ {
+
+ }
+ public void TestFun(K k)
+ {
+
+ }
+ }
+ #endregion
+
+ #region 知识点五 泛型的作用
+ //1.不同类型的对象的相同逻辑处理可以用泛型
+ //2.使用泛型可以一定程度上避免装箱拆箱
+ //举例:优化ArrayList
+ class ArrayList
+ {
+ private T[] array;//实现它的增删查改
+ }
+ #endregion
+
+
+
+ internal class Program
+ {
+ static void Main(string[] args)
+ {
+ Test t1 = new Test();
+ t1.value = 10;
+ Console.WriteLine(t1.value);
+
+ Test t2 = new Test();
+ t2.value = "test";
+ Console.WriteLine(t2.value);
+
+ Test5 t3 = new Test5();
+ t3.TestFun("123");
+
+ Test5 t4 = new Test5();
+ //t4.TestFun<("123");//不能是string了因为声明时是int
+ t4.TestFun("123");
+ t4.TestFun(1.23f);
+ }
+ }
+}
diff --git a/C#进阶/Lesson5_泛型练习/Lesson5_泛型练习.csproj b/C#进阶/Lesson5_泛型练习/Lesson5_泛型练习.csproj
new file mode 100644
index 0000000..2150e37
--- /dev/null
+++ b/C#进阶/Lesson5_泛型练习/Lesson5_泛型练习.csproj
@@ -0,0 +1,10 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/C#进阶/Lesson5_泛型练习/Program.cs b/C#进阶/Lesson5_泛型练习/Program.cs
new file mode 100644
index 0000000..e566422
--- /dev/null
+++ b/C#进阶/Lesson5_泛型练习/Program.cs
@@ -0,0 +1,33 @@
+namespace Lesson5_泛型练习
+{
+ internal class Program
+ {
+ static void Main(string[] args)
+ {
+ Console.WriteLine("Hello, World!");
+ Console.WriteLine(InputType());
+ Console.WriteLine(InputType());
+ Console.WriteLine(InputType());
+ Console.WriteLine(InputType());
+ Console.WriteLine(InputType());
+
+ }
+ public static string InputType()
+ {
+ if (typeof(T) == typeof(int))
+ {
+ return string.Format("{0},{1}字节", "整形", sizeof(int));
+ }else if (typeof(T) == typeof(float))
+ {
+ return string.Format("{0},{1}字节", "单精度浮点数", sizeof(float));
+ }else if (typeof(T) == typeof(double))
+ {
+ return string.Format("{0},{1}字节", "双精度浮点数", sizeof(double));
+ }else if (typeof(T) == typeof(string))
+ {
+ return string.Format("{0},{1}字节", "字符串", "不定长");
+ }
+ return "其他类型";
+ }
+ }
+}