using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ClassInherit
{
//父类Animal
class Animal
{
//private修饰,它的子类不可以访问
private string _PrivateValue = "private";
//protected修饰,它的子类继承得到
protected int _Weight = 20;
//pubic修饰,它的子类继承得到
public int Weight
{
<
C#基础知识之类继承
最新推荐文章于 2020-08-23 16:29:20 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)