wood burning stoves 2.0*
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "short and byte" Watch "short and byte" New topic
Author

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.


Thanks,
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
Sheriff

Joined: Oct 13, 2005
Posts: 37980
    
  22
See my first port of call for most of these thing, the Java Tutorials.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: short and byte
 
Similar Threads
compiler error
wrapper object
Casting Problem
doubt in switch.......
char compability...