using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace inheritance
{
class Handphone
{
public void call()
{
Console.WriteLine("call");
}
public void sms()
{
Console.WriteLine("sms");
}
}
class Blackberry : Handphone
{
public void b1()
{
Console.WriteLine("bbm");
base.call();
base.sms();
}
}
class nokia : Handphone
{
public void b2()
{
Console.WriteLine("camera");
base.call();
base.sms();
}
}
class dakota : Blackberry
{
public void d1()
{
{
Console.WriteLine("touch");
base.call();
base.sms();
}
}
class Program
{
static void Main(string[] args)
{
Blackberry obj1 = new Blackberry();
obj1.b1();
nokia obj2 = new nokia();
obj2.b2();
dakota obj3 = new dakota();
obj3.d1();
}
}
}
}
No comments:
Post a Comment