Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Signed and Unsigned int

 
ragi singh
Ranch Hand
Posts: 198
Oracle Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone explain the difference between Signed int and Unsigned int ?
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A signed int has both negative and positive values. An unsigned int is never ised in Java™. Other languages might used unsigned integers; for example C# has a type called uint, which is unsigned. It runs from 0 to 4294967295 inclusive, whereas the int type has the same range of values in C# and Java™: -2187483648 to 2147483647.

The only unsigned number used in Java™ is the char.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic