Interface - I Can Move
Interface - I Can Move
namespace Interfaces
{
class CalculatingShapes
{
static void Main(string[] args)
{
Console.WriteLine("\t\t\t\t Interface and Abstract ");
cat.Run();
cat.Drink();
cat.Eat();
Console.ReadLine();
}
}
interface ICanMove
{
// Methods
void Run();
void Back();
void GetVelocity();
}
interface ICanEat
{
// Methods
void Eat();
}
interface ICanDrink
{
// Methods
void Drink();
}
public abstract class Animal : ICanMove
{
// Methods
public abstract void Run();
public Cat(string n)
{
name = n;
}
public string GetName
{
get
{ return name;
}
set
{
if (value == null)
{
throw new ArgumentNullException("Can't be null");
}
else
{
this.name = value;
}
}
}
}
}