C# FAQ: How enforce constructor correctness in CSharp
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:FAQs |
| edit |
[edit]
How enforce constructor correctness in C# ?
Constructor correctness cannot be enforced in C#. Because, the Common Language Infrastructure (CLI) does not define constructor correctness. For instance, it cannot be specified that a method must not modify an argument being passed in to the method. Also, it cannot be specified that a method does not modify the object upon which it acts.
[edit]
See also
- Are C# constructors inherited?
- How can one constructor call another?
- Are constructors the same in C++ and C#?
- Are destructors the same in C++ and C#?
- How call a virtual method from a constructor or destructor?
- How do destructors work in C#?
- How enforce constructor correctness in C#?
- How make a C# destructor virtual?
- What are the differences between C# and Java constructors?
- What are the differences between C# finalizers and Java destructors?
- What is the syntax for calling an overloaded constructor from within a constructor?
- Why must
structconstructors have at least one argument?