Can you prevent your class from being inherited and becoming
a base class for some other classes?

Answer Posted / umesh

Yes, that?s what keyword sealed in the class definition is
for. The developer trying to derive from your class will get
a message: cannot inherit from Sealed class
WhateverBaseClassName. It?s the same concept as final class
in Java.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are three test cases you should go through in unit testing?

498


Is php easier than c#?

490


What is a multicast c# delegate?

505


What are the types of methods in c#?

457


Why do we use parameters in c#?

498






What is the purpose of escape sequence?

581


Can you see a loop recorder?

494


What is typeof undefined?

503


write a C# Program add two matrix ?

571


What is the use of partial methods?

567


Is string value type c#?

487


Is c# difficult to learn?

479


Why do we need constructor?

486


Why are strings in c# immutable?

493


What is the main purpose of linq?

475