Although the link provided by x2 is good, this is not all that is useful when dealing with unsigned primitives. For example: an int range is 2,147,483,648 to 2,147,483,647 (which is the same in both languages), but the C # s uint range is from 0 to 4,294,967,295. Java does not have a similar primitive type, so you have to use something that contains this range (in this case, long).
If you are only concerned about one-way compatibility (C # to Java), they should work:
- C # → java
- uint → long
- Int16 → short
- UInt16 → short
- Nullable -> look at classes that wrap primitive types (i.e. Integer wraps int)
EDIT :: I just found this article on MSDN about the differences between data types in two languages .
Rkitson
source share