Java and C# data type equivalents
When you develop enterprise data grid applications, data types between your Java and C# applications must be compatible.
Java type | C# type |
---|---|
boolean | bool |
java.lang.Boolean | bool? |
byte | sbyte or byte |
java.lang.Byte | sbyte? |
short | short?, ushort |
java.lang.Short | short?, ushort? |
int | int, uint, ushort |
java.lang.Integer | int?, uint? |
long | long, ulong, uint |
java.lang.Long | long?, ulong?, uint? |
short or int | ushort |
java.lang.Short or java.lang.Integer | ushort? |
int or long | uint |
java.lang.Integer or java.lang.Long | uint? |
long or BigInteger | ulong |
java.lang.Long or java.lang.BigInteger | ulong? |
char, java.lang.Character | char |
java.lang.Character | char? |
float, java.lang.Float | float |
java.lang.Foat | float? |
double | double |
java.lang.Double | double? |
java.math.BigDecimal | decimal or decimal? |
java.math.BigInteger | decimal, long or ulong? |
java.lang.String | string |
java.util.Date, java.util.Calendar | System.DateTime |
java.util.Date(rounding), java.util.Calendar(rounding) | System.DateTime |
java.util.ArrayList | System.Collections.ArrayList, System.Collections.Generic.List |
java.util.HashMap | System.Collections.Generic.Dictionary, System.Collections.Hashtable |
java.util.LinkedList | System.Collections.Generic.LinkedList |
java.util.ArrayList, java.util.Vector | System.Collections.Generic.List |
java.util.Stack | System.Collections.Generic.Stack |
java.util.Vector | System.Collections.ArrayList, System.Collections.Generic.List |