0

I have some code bellow and I get an exception what wrong with this code, I'm just started to study with section of OOP so maybe I made a stupid mistake :

static void Main(string[] args)
        {
            Ishow c1 = new Circle(1, 2, 10);
            c1.show();


interface Ishow
    {
        void show();
    }
 class Circle:Ishow
    {
        //data members
        private double x, y;
        private double radius;

        //constructors
        public Circle()
        {
        }

        public Circle(double X, double Y, double Radius)
        {
            this.x = X;
            this.y = Y;
            this.radius = Radius;
        }

        //Methods
        private void Show()
        {
            Console.WriteLine("Cordinates of Circle : X={0,3} Y={1,3} and Radius={2,3}", x, y, radius);
        }

        public void Print(Ishow x)
        {
            x.show();
        }
    }

the mistake I get is : "....does not implement interface ,member..."
Thanks Sergey

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by LizR
0

You do not implement your interface indeed!
interface says void show() and you do private void Show() . That's not the same!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.