From d9135dc3d4ae2f2c0aaffa8f4dc76be292378a02 Mon Sep 17 00:00:00 2001 From: Kister Hakusan <2753888203@qq.com> Date: Mon, 8 Sep 2025 12:32:22 +0800 Subject: [PATCH] test1 --- C#核心/C#核心.sln | 6 ++++ .../Lesson12_继承-继承的基本概念练习.csproj | 11 ++++++ .../Lesson12_继承-继承的基本概念练习/Program.cs | 34 +++++++++++++++++++ .../Lesson12_继承-继承的基本概念练习.csproj | 10 ++++++ .../Lesson12_继承_继承的基本概念练习/Program.cs | 34 +++++++++++++++++++ 5 files changed, 95 insertions(+) create mode 100644 C#核心/Lesson12_继承-继承的基本概念练习/Lesson12_继承-继承的基本概念练习.csproj create mode 100644 C#核心/Lesson12_继承-继承的基本概念练习/Program.cs create mode 100644 C#核心/Lesson12_继承_继承的基本概念练习/Lesson12_继承-继承的基本概念练习.csproj create mode 100644 C#核心/Lesson12_继承_继承的基本概念练习/Program.cs diff --git a/C#核心/C#核心.sln b/C#核心/C#核心.sln index 7f6507e..ca6ddad 100644 --- a/C#核心/C#核心.sln +++ b/C#核心/C#核心.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lesson10_封装-运算符 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lesson11_内部类和分部类", "Lesson11_内部类和分部类\Lesson11_内部类和分部类.csproj", "{51A60C77-3609-42BD-B0D9-83E1B61B6E69}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lesson12_继承-继承的基本概念练习", "Lesson12_继承_继承的基本概念练习\Lesson12_继承-继承的基本概念练习.csproj", "{DD7B30CE-773B-4752-9703-D0D5E6E4F376}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {51A60C77-3609-42BD-B0D9-83E1B61B6E69}.Debug|Any CPU.Build.0 = Debug|Any CPU {51A60C77-3609-42BD-B0D9-83E1B61B6E69}.Release|Any CPU.ActiveCfg = Release|Any CPU {51A60C77-3609-42BD-B0D9-83E1B61B6E69}.Release|Any CPU.Build.0 = Release|Any CPU + {DD7B30CE-773B-4752-9703-D0D5E6E4F376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DD7B30CE-773B-4752-9703-D0D5E6E4F376}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DD7B30CE-773B-4752-9703-D0D5E6E4F376}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD7B30CE-773B-4752-9703-D0D5E6E4F376}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/C#核心/Lesson12_继承-继承的基本概念练习/Lesson12_继承-继承的基本概念练习.csproj b/C#核心/Lesson12_继承-继承的基本概念练习/Lesson12_继承-继承的基本概念练习.csproj new file mode 100644 index 0000000..8c374af --- /dev/null +++ b/C#核心/Lesson12_继承-继承的基本概念练习/Lesson12_继承-继承的基本概念练习.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + Lesson12_继承_继承的基本概念练习 + enable + enable + + + diff --git a/C#核心/Lesson12_继承-继承的基本概念练习/Program.cs b/C#核心/Lesson12_继承-继承的基本概念练习/Program.cs new file mode 100644 index 0000000..d72b5f5 --- /dev/null +++ b/C#核心/Lesson12_继承-继承的基本概念练习/Program.cs @@ -0,0 +1,34 @@ +namespace Lesson12_继承_继承的基本概念练习 +{ + class Human + { + public string name; + public int age; + public void Speak() + { + Console.WriteLine("说话"); + } + } + class Warrior : Human + { + public int atk; + public void Attack() + { + Console.WriteLine("攻击"); + } + } + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello, World!"); + Warrior w = new Warrior(); + w.name = "HK"; + w.age = 18; + w.Speak(); + w.atk = 5; + w.Attack(); + + } + } +} diff --git a/C#核心/Lesson12_继承_继承的基本概念练习/Lesson12_继承-继承的基本概念练习.csproj b/C#核心/Lesson12_继承_继承的基本概念练习/Lesson12_继承-继承的基本概念练习.csproj new file mode 100644 index 0000000..2150e37 --- /dev/null +++ b/C#核心/Lesson12_继承_继承的基本概念练习/Lesson12_继承-继承的基本概念练习.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/C#核心/Lesson12_继承_继承的基本概念练习/Program.cs b/C#核心/Lesson12_继承_继承的基本概念练习/Program.cs new file mode 100644 index 0000000..d72b5f5 --- /dev/null +++ b/C#核心/Lesson12_继承_继承的基本概念练习/Program.cs @@ -0,0 +1,34 @@ +namespace Lesson12_继承_继承的基本概念练习 +{ + class Human + { + public string name; + public int age; + public void Speak() + { + Console.WriteLine("说话"); + } + } + class Warrior : Human + { + public int atk; + public void Attack() + { + Console.WriteLine("攻击"); + } + } + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello, World!"); + Warrior w = new Warrior(); + w.name = "HK"; + w.age = 18; + w.Speak(); + w.atk = 5; + w.Attack(); + + } + } +}