sweety2010 wrote:
If am declaring a sealed class,it means that i cannot inherit it.
which is 100% true
sweety2010 wrote:
a sealed class is containing a function with public access specifier.
sealed class radix
{
public void fun()
{
Console.WriteLine("Hello");
}
}
OK now...
sweety2010 wrote:
I just want to know that this function can be inherited or not?????
No the class is sealed and the function fun() is inside the sealed class radix so u cannot Inherit that
sweety2010 wrote:
if yes then how is ii possible?
Yes it is possible with the help of the code given below
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
sealed class radix
{
public void fun()
{
Console.WriteLine("Hello");
}
}
class Program
{
static void Main(string[] args)
{
radix obj = new radix();
obj.fun();
}
}
}
By creating the object of the sealed class Radix any attempt to inherit radix will cause an error and the compiler will not allow it.
Do rate my answer once you find it useful
Thanks & Regards
Radix :)