217.
Can you allow class to be inherited, but prevent the method from being over-ridden?
View Description
using System;
using System.Collections.Generic;
public class A
{
public virtual int Calculate(int num1, int num2)
{
return num1 num2;
}
}
public class B : A
{
public override int Calculate(int num1, int num2)
{
return num1 - num2;
}
}
class C : B
{
public override int Calculate(int num1, int num2)
{
return num1 - num2;
}
static void Main()
{
B obj = new B();
int answer = obj.Calculate(24, 12);
}