childclass obj=new childclass;
absparent p=obj;
p.test1();p.test2();p.test3();
where test1 and test 2 are methods of abstract class
while test 3 are methods of child class
How to use reference of a abstract class?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Munesh SharmaRank #174 · 13.9K reputationPosted May 2, 2014, 1:36 AM EDT
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication13
{
abstract class mcn
{
public int add(int a, int b)
{
return (a + b);
}
}
class mcn1 : mcn
{
public int mul(int a, int b)
{
return a * b;
}
}
class test
{
static void Main(string[] args)
{
mcn1 ob = new mcn1();
int result = ob.add(5, 10);
Console.WriteLine("the result is {0}", result);
}
}
}
VulpesRank #55 · 29.2K reputationPosted May 2, 2014, 1:48 AM EDT