Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

short and byte

 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between a short and a byte datatype?What can be the range of numbers that i can include in short and byte?

Is it like short can be from -100 to 100?
Request help.
 
Shahnawaz Shakil
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Byte is 8 bit signed data type and short is 16 bit signed data type. Thus for byte, the range is -128 to 127. Please calculate the range of short yourself.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50216
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See my first port of call for most of these thing, the Java Tutorials.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic