• Post Reply Bookmark Topic Watch Topic
  • New Topic

type casting a character  RSS feed

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
short is a signed integer and its values can range from -32768 to 32767.
Character is an insigned integer and values can range from 0 to 65535

If a charactet has a value of less than 32767 then it can be type casted to same value as short.
What happens if a character has vaue of more than 32767 ? If I type cast it to short, what will be the resulting value ?

Thanks
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nirjari patel wrote:... What happens if a character has vaue of more than 32767 ? If I type cast it to short, what will be the resulting value ? ...

If only there were some way to test that...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!