C# FAQ: What are the differences between CSharp and Java primitive types

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 member primitive types?

There is a corresponding C# type for every Java primitive type which has the same name. The byte type is the exception. The Java byte type is signed; therefore, it is the equivalent of the C# sbyte type rather than the C# byte type.

C# has unsigned versions of certain primitives, i.e., byte, uint, ulong, and ushort.

Only one C# primitive is significantly different than the Java types—the decimal type. The decimal type holds decimal numbers without rounding errors. Of course, the tradeoff is space and speed.

See also


Personal tools