cat.cs

来自「Microsoft?Visual C#?.NET (Core Reference」· CS 代码 · 共 29 行

CS
29
字号
using System;
namespace MSPress.CSharpCoreRef.Animals
{
    public class Cat: LandAnimal
    {
        public Cat()
        {
        }

        public Cat(string aName)
        {
            _name = aName;
        }

        public void OverthrowHumans()
        {
            Console.WriteLine("Cat: " + _name + " is planning to overthrow the humans."); 
        }

        public void CoughUpFurballs()
        {
            Console.WriteLine("Cat: " + _name + " is coughing up furballs."); 
        }

        // Fields are normally protected or private. This field is public
        // in order to describe the syntax.
        public static int mouseEncounters;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?