/* Program in C# for implementation of multiway inheritance */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Inherit
{
class One:Mammal
{
public void Noise()
{
Console.WriteLine("Dog Barks");
}
static void Main(string[] args)
{
One obj = new One();
obj.Eat();
obj.feature();
obj.Noise();
}
}
class Animal
{
public void Eat()
{
Console.WriteLine("Every Animal Eats Something");
}
}
class Mammal : Animal
{
public void feature()
{
Console.WriteLine("Mammal Gives birth to young ones");
}
}
}
//Output
//Every Animal Eats Something
//Mammal Gives birth to young ones
//Dog Barks
Saturday, June 14, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment