c# - What is the significance of a sealed partial class? -


in c#, significance of sealed partial class?

a sealed class class cannot inherited.

a partial class class can split between 2 or more source files.

so why "sealed partial class have significance?

a partial class syntactic sugar, can define class in 2 different files, in same assembly. useful when part of class generated, example using entity framework db first approach. has nothing inheritance.

a sealed class class cannot inherited. make class sealed if inheriting potentially break it, need accessable outside of own code.

there no relation between 2 keywords. sealed partial class class, might defined in more files, , cannot inherited from.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -