Monday, March 22, 2010

Abut: Abstract class

public abstract class AbstractClass
{
public abstract void AbstractMethod1();
public abstract void AbstractMethod2();

}


public class classA : AbstractClass
{

public override void AbstractMethod1()
{
//some functionality goes here
}

public override void AbstractMethod2()
{
//some functionality goes here

}
}




public class classB : AbstractClass
{

public override void AbstractMethod1()
{
//some functionality goes here
}

public override void AbstractMethod2()
{
//some functionality goes here

}
}


//How can we remove AbstractMethod2 from classB without
//removing AbstractMethod2 method from AbstractClass and without
//removing the classB : AbstractClass relationship