• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java SE 8 for the Really Impatient Question

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 284
35
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic