Why can’t struct be used instead of class for storing entity?
Answer / 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 |
What is static class in C#?
How to authenticate web service? When you enter the web service url in browser it should ask username and password. After entering the un&pwd we have to show its methods and service description(wsdl).
Whats an assembly? Describe the importance of assembly?
What is datacontract in c#?
What is serialization in unity?
Oops concepts ?
2 Answers Accenture, Digital GlobalSoft,
What?s the top .NET class that everything is derived from?
What is readline library?
Why are c# strings immutable?
What is a static class in c#?
Can a structure be inherited by a class?
What is the purpose of private constructor in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)