C# FAQ: What are the differences between CSharp and Java constructors
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:FAQs |
| edit |
[edit]
What are the differences between C# and Java constructors?
The constructor semantics and syntax for C# are identical to those of the Java language.
The following C# and Java examples are equivalent:
using System; public class CSharpClass { CSharpClass () { } }
public class JavaClass { JavaClass() { } }
[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? - C# for Java Developers