How to provide the different implementations to two abstract classes methods and methods name are same
Example
abstract class abstA
{
public abstract void get(int num);
}
abstract class abstB
{
public abstract void get();
}
How to use the get() method of two abstract classes
Loading
Blocked AccountPosted Sep 26, 2008, 3:19 AM
Hi Manoj
U can do this by using this code
class Testing
{
public abstract class abstA
{
public abstract void get(int num) ;
}
public abstract class abstB
{
public abstract void get();
}
public class Use1 : abstA
{
public override void get(int num)
{
//must do some work here
}
}
public class Use2 : abstB
{
public override void get()
{
//must do some work here
}
}
static void Main()
{
Use1 use1 = new Use1 ();
Use1 use2 = new Use2 ();
use1.get(int x);
use2.get();
}
}
Happy Coding!!