hi, could you please explain me when do we need byte datatype? similarly, could you also please tell me the situation the Shift operators (>>, >>>) are required? thanks. [ edited to diable smilies -ds ] [ June 15, 2003: Message edited by: Dirk Schreckmann ]
The byte datatype is needed to store integer values within range in the least amount of memory. A JVM might be implemented on processors with smaller than 32-bit registers, and memory resources are not always abundant. Not many people "have" to use bit-shifting in "normal" coding. It's been a while, but IIRC some compression algorithms use bit-shifting. I'm sure there are other situations too.
Some mathematical operations can be done more quickly with the bit shifting operators. The byte datatype is also useful when the data to be used/manipulated is available in byte-sized pieces (such as with some I/O operations). [ June 22, 2003: Message edited by: Dirk Schreckmann ]