提交 2eda9329 编写于 作者: S spe_or_feed

Initial commit

C++inherit example1.1
上级
# Auto detect text files and perform LF normalization
* text=auto
using System;
using System.Collections.Generic;
using System.Text;
namespace study02_13继承例题
{
class Kangkang:Person
{
public Kangkang(string name,int age,string hobby,string food)
:base(name, age, hobby)
{
this.Food = food;
}
private string _food;
public string Food { get => _food; set => _food = value; }
public void KangknagSay()
{
Console.WriteLine("我叫{0},今年{1}岁,我爱{2},我最喜欢的食物是{3}", this.Name, this.Age, this.Hobby, this.Food);
}
}
}
using System;
using System.Collections.Generic;
using System.Net.Cache;
using System.Text;
namespace study02_13继承例题
{
class Likang:Person
{
public Likang(string name, int age, string hobby,string work)
: base(name, age, hobby)
{
this.Work = work;
}
private string work;
public string Work { get => work; set => work = value; }
public void LikangSay()
{
Console.WriteLine("{0}{1}", this.Name, this.Age);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace study02_13继承例题
{
class Person
{
public Person(string name, int age, string hobby)
{
this.Name = name;
this.Age = age;
this.Hobby = hobby;
}
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
private int _age;
public int Age { get => _age; set => _age = value; }
private string _hobby;
public string Hobby { get => _hobby; set => _hobby = value; }
}
}
using System;
namespace study02_13继承例题
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Kangkang kangkang = new Kangkang("kangkang", 10, "吃东哥做的饭", "东哥做的");
kangkang.KangknagSay();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace study02_13继承例题
{
class Shitking : Person
{
public Shitking(string name, int age, string hobby, string work)
: base(name, age, hobby)
{
this.Work = _work;
}
private string _work;
public string Work
{ get => _work; set => _work = value; }
public void ShitkingSayhi()
{
Console.WriteLine("{0},{1},{2},{3}", this.Name, this.Age, this.Work, this.Hobby);
}
}
}
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v3.1",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v3.1": {
"study02-13继承例题/1.0.0": {
"runtime": {
"study02-13继承例题.dll": {}
}
}
}
},
"libraries": {
"study02-13继承例题/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
\ No newline at end of file
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\spe\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\spe\\.nuget\\packages",
"C:\\Microsoft\\Xamarin\\NuGet"
]
}
}
\ No newline at end of file
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "3.1.0"
}
}
}
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("study02-13继承例题")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("study02-13继承例题")]
[assembly: System.Reflection.AssemblyTitleAttribute("study02-13继承例题")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\obj\Debug\netcoreapp3.1\study02-13继承例题.csprojAssemblyReference.cache
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\obj\Debug\netcoreapp3.1\study02-13继承例题.csproj.CoreCompileInputs.cache
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\obj\Debug\netcoreapp3.1\study02-13继承例题.AssemblyInfoInputs.cache
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\obj\Debug\netcoreapp3.1\study02-13继承例题.AssemblyInfo.cs
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\bin\Debug\netcoreapp3.1\study02-13继承例题.exe
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\bin\Debug\netcoreapp3.1\study02-13继承例题.deps.json
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\bin\Debug\netcoreapp3.1\study02-13继承例题.runtimeconfig.json
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\bin\Debug\netcoreapp3.1\study02-13继承例题.runtimeconfig.dev.json
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\bin\Debug\netcoreapp3.1\study02-13继承例题.dll
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\bin\Debug\netcoreapp3.1\study02-13继承例题.pdb
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\obj\Debug\netcoreapp3.1\study02-13继承例题.dll
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\obj\Debug\netcoreapp3.1\study02-13继承例题.pdb
C:\Users\spe\source\repos\study02-13继承例题\study02-13继承例题\obj\Debug\netcoreapp3.1\study02-13继承例题.genruntimeconfig.cache
{
"version": 3,
"targets": {
".NETCoreApp,Version=v3.1": {}
},
"libraries": {},
"projectFileDependencyGroups": {
".NETCoreApp,Version=v3.1": []
},
"packageFolders": {
"C:\\Users\\spe\\.nuget\\packages\\": {},
"C:\\Microsoft\\Xamarin\\NuGet\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\study02-13继承例题.csproj",
"projectName": "study02-13继承例题",
"projectPath": "C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\study02-13继承例题.csproj",
"packagesPath": "C:\\Users\\spe\\.nuget\\packages\\",
"outputPath": "C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Microsoft\\Xamarin\\NuGet\\"
],
"configFilePaths": [
"C:\\Users\\spe\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.201\\RuntimeIdentifierGraph.json"
}
}
}
}
\ No newline at end of file
{
"version": 2,
"dgSpecHash": "NVJGEmisE+Y+1tZvlUwfMrnS+Z8neBPiSf5VZVYrHJH1ClWZsyI0rU/so1KvXalSV5zhqrPp6BlZAuiX3a+FeA==",
"success": true,
"projectFilePath": "C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\study02-13继承例题.csproj",
"expectedPackageFiles": [],
"logs": []
}
\ No newline at end of file
{
"format": 1,
"restore": {
"C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\study02-13继承例题.csproj": {}
},
"projects": {
"C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\study02-13继承例题.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\study02-13继承例题.csproj",
"projectName": "study02-13继承例题",
"projectPath": "C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\study02-13继承例题.csproj",
"packagesPath": "C:\\Users\\spe\\.nuget\\packages\\",
"outputPath": "C:\\Users\\spe\\source\\repos\\study02-13继承例题\\study02-13继承例题\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Microsoft\\Xamarin\\NuGet\\"
],
"configFilePaths": [
"C:\\Users\\spe\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.201\\RuntimeIdentifierGraph.json"
}
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\spe\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.5.0</NuGetToolVersion>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>study02_13继承例题</RootNamespace>
</PropertyGroup>
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册