Answer to Question #241856 in C# for Gayatri

Question #241856
Create class bird and implement it with interface function
Code for beginners.
1
Expert's answer
2021-09-24T18:55:53-0400
namespace ConsoleApplication1
{
    interface IBird
    {
        void fly();
    }
    
    class Bird : IBird
    {
        public int x;
        public int y;

        public Bird(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        public void fly()
        {
            y += 10;
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS