Structs and Classes Difference :
Structs are similar to classes in definition and syntax. Lets see the example of structs :
What is the difference :
Struct is a value type and class is a reference type.
Structs cant have destructors.
Structs cant support inheritance.
Structs are stored on Stack and class are stored in Heap.
What is sealed Keyword mean?
We use sealed keyword to stop a class being used in inheritance purpose and structs are by default sealed.
Syntax :
class sealed ClassVariablename
No comments:
Post a Comment