adspace
Why can’t struct be used instead of class for storing entity?
Answer Posted / Jeetender Pal Singh
In C#, structures (structs) are value types while classes are reference types. This difference leads to some limitations when using structs as entities. For instance, they cannot inherit from multiple base classes or implement interfaces, they don't support constructors with parameters, and they don’t have a built-in concept of inheritance. Structs also can’t be used to create a true object-oriented programming (OOP) model like classes.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers