01 简单工厂模式/OperationLibrary/Operation.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
* ==============================================================================
*
* File name: Operation
* Description: 
*
* Version: 1.0
* Created: 2015-07-07 10:59:44
*
* Author: Your name
* Company: Your company name
*
* ==============================================================================
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OperationLibrary
{
    /// <summary>
    /// 运算类(父类)
    /// </summary>
    public class Operation
    {
        double numberA;

        public double NumberA
        {
            get { return numberA; }
            set { numberA = value; }
        }

        double numberB;

        public double NumberB
        {
            get { return numberB; }
            set { numberB = value; }
        }

        double result;
        /// <summary>
        /// 运算结果
        /// </summary>
        public double Result
        {
            get { return result; }
            set { result = value; }
        }

        /// <summary>
        /// 虚函数,实现多态。子类中重写该函数
        /// </summary>
        /// <returns></returns>
        public virtual double GetResult()
        {
            return Result;
后面还有 116 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。