Pure Abstraction
using System;
/* Class having abstract keyword and having, abstract keyword with all of its methods (not some) is known as
a pure abstract Base Class. */
abstract class Human
{
// All methods are abstract
public abstract void see();
public abstract void hear();
public abstract void walk();
}
//Now we derive a class of 'Student' from the class Human which should implement all abstract methods in the baseclass Human.
class Student : Human
{
public override void see()
{
Console.WriteLine("Humans can see");
}
public override void hear()
{
Console.WriteLine("Humans can hear");
}
public override void walk()
{
Console.WriteLine("Humans can walk");
}
static void Main(String[] args)
{
Student c = new Student();
c.see();
c.hear();
c.walk();
Console.ReadLine();
}
}
Output:
Humans can see
Humans can hear
Humans can walk