Equivalent to ushort
3 answers
The closest equivalent in size is char
as Java has no unsigned types, but it is overloaded in Java to provide additional semantics related to individual characters. In general, just select the next largest integral type ( int
in this case). ( You are not the only one who wants this.)
+4
source to share
As you know, Java has no unsigned numbers . This means you have to go with a different solution. It is generally easiest to use the next larger type in cases such as int
(it's just a 32-bit signed integer).
+1
source to share