Forums Register Login

Java SE 8 for the Really Impatient Question

+Pie Number of slices to send: Send
Hi Cay,

Do you have any personal opinion with the addition of unsigned ints? I think Sun had left them out to keep the language simpler. Do you think the need for them has trumped the need for simplicity?

Thanks.
1
+Pie Number of slices to send: Send
unsigned int isn't there as a datatype. There are only a few library calls to enable working with them. You store them in regular ints. Then you have to know the rules of two's complement arithmetic. Adding and subtracting works out of the box. But to compare two 32-bit unsigned quantities that are stored in int variables, you can't use <. Instead, use Integer.compareUnsigned.

It's inconvenient enough that only those people who really need them will use them.

Cheers,

Cay
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 930 times.
Similar Threads
Webservice using JAX-WS
Where can we find a lovable job?
Swing Client...
recursively checkout and checkin
string tokenizer prob
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 03:24:55.