23# Abstraction INTERFACE Object Oriented Programming
23# Abstraction INTERFACE Object Oriented Programming
using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
}
}
}
}
}
}
}
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||
using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
IAnimal a = new Dog();
ILandAnimal b = new Dog();
a.makeSound();
b.walk();
aa.makeSound();
bb.walk();
aaa.makeSound();
bbb.walk();
ccc.walk();
ccc.fly();
}
}
interface IAnimal
{
void makeSound();
}
interface ILandAnimal
{
void walk();
}
interface IAirAnimal:ILandAnimal
{
void fly();
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||
using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
Dog a = new Dog();
Bird aa = new Bird();
Cat aaa = new Cat();
a.walk();
a.makeSound();
aa.fly();
aa.walk();
aa.makeSound();
aaa.walk();
aaa.makeSound();
}
}
interface IAnimal
{
void makeSound();
}
interface ILandAnimal
{
void walk();
}
interface IAirAnimal:ILandAnimal
{
void fly();
}
class Dog : IAnimal,ILandAnimal
{
public void makeSound()
{
Console.WriteLine("Arf");
}
public void walk()
{
Console.WriteLine("Dog is Walking");
}
}