Answer: We can do so if we declare the method as static. Then by using Classname.MethodName() we can invoke it.
Example:
class Program
{
static void Main(string[] args)
{
MyBase.Hello();
Console.ReadKey();
}
}
public abstract class MyBase
{
public static void Hello()
{
Console.WriteLine("Hello");
}
}
Asked In: Many Interviews |
Alert Moderator