Qus:    Can sealed class can be inherited?
Dec 11, 2020 21:21 DotNet 2 Answers Views: 1560 FRAUSKY

 Public class sealed ParentClass {

Public void Method1()

{

}

}

Public class MyChildClass:

ParentClass -> It will throw the error due to sealed class ,

it will allow to inherited in the child class

{

Public Void Method2()

{

}

}

Prev Next
Answers (2)
PARTH Dec 12, 2020 08:58
Answer:   No, a sealed class cannot be inherited.

SHIVA Dec 12, 2020 14:26
Answer:   Public class sealed ParentClass {
Public void Method1()
{
}
}
Public class MyChildClass:
ParentClass -> It will throw the error due to sealed class ,
it will allow to inherited in the child class
{
Public Void Method2()
{
}
}

Post Your Answer
Guest User

Not sure what solution is right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect