日期:2014-05-17  浏览次数:20857 次

请教各位老师,这段代码为什么会提示无法实现接口成员?
提示是这个问题:“A.Me”不实现接口成员“A.Ibankio.have”。“A.Me.have”无法实现接口成员,因为它不是公共的
请教各位大神,这是为什么呢?



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A
{
    interface Ibankio
    {
        decimal have  //已有钱数
        {
            get;
            set;
        }
        void In(decimal a);//存入钱数;
        void Out(decimal b);//支出钱数;
        /*decimal c//剩余钱数
        {
            get;
            set;

        }*/
    
    }

    class Me:Ibankio
    {
        private decimal have
        {
            get
            {
                return have;
            }
            set
            {
                if (have < 0)
                {
                    Console.WriteLine("卡内余额不足");
                }
            }
        }
        public void In(decimal a)
        {
            have += a;