why to use abstract class as type? : <p>I have fair understanding of interface/abstract class/class however just trying to understand something else. Look at below code:</p>

<pre><code>namespace AbstractClassExample
{
    class Program
    {
        static void Main(string[] args)
        {
            BaseEmployee fullTimeEmployee = new FullTimeEmployee();

            BaseEmployee contractEmployee = new ContractEmployee();
        }
    }

    public abstract class BaseEmployee
    {
        public string EmployeeID { get; set; }
        public string EmployeeName { get; set; }
        public string EmployeeAddress { get; set; }

        public abstract double CalculateSalary(int hoursWorked);
    }

    public class FullTimeEmployee : BaseEmployee
    {
        public override double CalculateSalary(int hoursWorked)
        {
            //do something
        }
    }

    public class ContractEmployee : BaseEmployee
    {
        public override double CalculateSalary(int hoursWorked)
        {
            //do something
        }
    }
}
</code></pre>

<p>however I fail to get below lines (1st approach): </p>

<pre><code>BaseEmployee fullTimeEmployee = new FullTimeEmployee();
BaseEmployee contractEmployee = new ContractEmployee();
</code></pre>

<p>Why not written this way instead (2nd approach):</p>

<pre><code>FullTimeEmployee fullTimeEmployee = new FullTimeEmployee();
</code></pre>

<p>it is completely okay to use 2nd approach it will work coz of relation. How would any developer in the work know if above abstract class is in DLL. Probably, will use 1st approach when you've code with you or sort of documentation. Isn't it?</p>

<p>Similar example would also be valid for interface declaration. like:</p>

<pre><code>interface IPointy {
    void MyMethod();
}

class Pencil : IPointy {
    void MyMethod() {
    }

    void MyOtherMethod() {
    }
}

IPointy itPt = new Pencil();
</code></pre>

<p>Isn't 1st approach making it complex? What's good practice? Any good practice vs bad practice with 1st &amp; 2nd? </p>
