aspose file tools
The moose likes Beginning Java and the fly likes short and byte Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "short and byte" Watch "short and byte" New topic

short and byte

Phillipe Rodrigues
Ranch Hand

Joined: Oct 30, 2007
Posts: 165
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

Joined: Aug 04, 2008
Posts: 57
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

Joined: Oct 13, 2005
Posts: 42670
See my first port of call for most of these thing, the Java Tutorials.
subject: short and byte