Questions tagged [sealed]

The sealed modifier keyword prevents a C# class from being inherited. Similar to the final keyword in Java.

The sealed modifier keyword prevents a C# class from being inherited. Similar to the final keyword in Java.

183 questions
-3
votes
2 answers

can't use a sealed type as a generics constraints

I really need a logical explanation for that. Why did they do it? Why is using a sealed type as a constraint is not a good practice? I need the same function running for some types, and they happen to be sealed, what's wrong with that? and is…
ByoTic
  • 333
  • 1
  • 4
  • 16
-3
votes
2 answers

Can a sealed or static class be declared inside a sealed class in C#?

These are two separate questions: Can a class marked as sealed be present inside a sealed class? Can a class marked as static be present inside a sealed class? These questions are just out to have better understanding of the core concepts. Can…
Amit
  • 1
  • 1
-4
votes
1 answer

Real time use of abstract, sealed and static class

If I've some common functionality that I've to keep in a class, so will I go for static, sealed or abstract class...Does all these types of classes serve the purpose of keeping the common functionality together...where actually the difference lies…
Bhuwan Pandey
  • 514
  • 1
  • 6
  • 19
1 2 3
12
13