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


Jump to: navigation, search
CSharp-Online.NET:FAQs
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()
   {  
   }
 
}

See also


Personal tools