I want to assign 4294967295 variable ( 2^32-1 ) Obviously, I cannot do this with Integer and do it with Long .
However, I noted that Java 8 offers Unsigned Integer (at least some methods).
Does anyone know what the Integer.parseUnsignedInt() method Integer.parseUnsignedInt() ? When I enter "4294967295" to this and print the variable, it gives the result as -1 ( -2 for 4294967294 , -3 for 4294967293 , etc.)
Is there a way that I can still have 4294967295 in a variable?
Did I miss something?
a=Integer.parseUnsignedInt("4294967295"); System.out.println(a);
This gives a result as -1 , but I was expecting 4294967295 .
java java-8 int unsigned
Pubudu Dodangoda
source share