how to prevent a class from being inherited in c#.net?



how to prevent a class from being inherited in c#.net?..

Answer / Abhineet Kumar Saxena

"To prevent a class from being inherited in C#, you can use the sealed keyword. Here's an example:nn```csharpnpublic sealed class SealedClass{n}n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

what are pointer types in c#

1 Answers   Cognizant,


Can you create an instance of a static class?

1 Answers  


What is ienumerable and iqueryable?

1 Answers  


What do you mean by saying a "class is a reference type"?

1 Answers  


Can abstract class have constructor?

1 Answers  


List some Advantages of switch-case over if else?

1 Answers  


Can you instantiate an abstract class c#?

1 Answers  


What are winforms in c#?

1 Answers  


What are the differences between a class and a struct?

1 Answers  


What are the 3 logical operators?

1 Answers  


What is a c# delegate?

1 Answers  


What is the benefit of using interface in c#?

1 Answers  


Categories