using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Lab8
{
abstract class person
{
protected string fname;
protected string lname;
public person(string fn, string ln)
{
fname = fn;
lname = ln;
}
public abstract void display() ;
}
class emp : person
{
public ushort year;
public emp(string fn, string ln, ushort yr): base(fn, ln)
{
year = yr;
}
public override void display()
{
Console.WriteLine("Employee :" + fname + " " + lname + " " + year);
}
}
class worker : person
{
public String company;
public worker(string fn, string ln, string c) : base(fn, ln)
{
company = c;
}
public override void display() {
Console.WriteLine("Worker :" + fname + " " + lname + " " + company);
}
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine("**ABSTRACT CLASS AND ABSTRACT METHODS DEMO **");
person p2 = new emp("RAM", "KUMAR", 2012);
person p3 = new worker("RAM", "KUMAR", "ABC TECH SOLS");
p2.display();
p3.display();
Console.ReadLine();
}
}
}