c# - 错误 : Does not implement interface member

标签 c# interface

我是 c# 的新手,我在实现接口(interface)方面有点吃力,如果有人能帮助我解决这个问题并提供解释,我将不胜感激。谢谢

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace interfejsi
 interface Figura
{
  String Plostina ();
  String Perimeter ();
}
}
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 namespace interfejsi
{
 class Kvadar : Figura
{
    int a,b,c;
    public  String Perimetar(int a, int b, int c)
    {
        return (a + b + c).ToString();
    }
    public String Plostina(int a, int b, int c)
    {
        return (a * b * c).ToString();
    }
}

最佳答案

您需要实现接口(interface)中的确切功能(使用相同数量的输入参数)..

所以在您的情况下,将您的界面更改为:

interface Figura
{
   String Perimetar(int a, int b, int c)
   String Plostina(int a, int b, int c)
}

或者将您的实现更改为不带参数的函数。

关于c# - 错误 : Does not implement interface member,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23170561/

相关文章:

c# - 如何在自定义 WPF 控件中呈现动态数据,例如折线图?

java - 参数化接口(interface)可以是子接口(interface)吗?

perl - 我如何需要带有接口(interface)的 Moose 属性?

c# - 当位掩码(标志)枚举变得太大时该怎么办

c# - 关于 Async 和 Await 的工作原理 c#

c# - 使用Linq XDocument读取XML文件的最后n个元素

c# - 外部关闭excel进程时的错误处理

java - java中的类端方法是什么意思?

interface - Golang 接口(interface)和接收器 - 需要建议

c# - 接口(interface)版本控制问题