.NET and Java Primitive Types

By ruzaib khan

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.

.NET and Java Primitive Types  (806 Views)