-
Interface Issue
Can someone tell me ?when i tried to compile .why i am getting error ?'ExInterface.Myimages' does not implement interface member 'ExInterface.ipict.DeleteImage()' C:\Documents and Settings\Administrator.IT\Local Settings\Application Data\Temporary Projects\ExInterface\Program.cs.let me know please.
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace ExInterface
{
public interface ipict
{
int DeleteImage();
void DisplayImage();
}
public class Myimages : ipict
{
public int deleteImage()
{
Console.Writeline("DeleteImage Implementation!");
return (0);
}
public void DisplayImage()
{
Console.WriteLine("Display ImageImplementation");
}
}
class test
{
static void Main()
{
Myimages m=new Myimages();
m.DisplayImage();
int t=m.deleteImage();
}
}
}
-
Re: Interface Issue
C# is case-sensitive. In Interface ipict, you have DeleteImage but in class MyImages, you have deleteImage. Try replacing deleteImage with DeleteImage.
-
Re: Interface Issue
another tip:
when you declare your implementation of the interface in your class, wait a second or so, and you will see the interface decleration being somewhat highlighted at the beginning of the name of the interface. hover over this and then click a button that appears and within here, you can tell Visual Studio to implement the interface members or even explicitly implement the interface members.