Types range | SoloLearn: Learn to code for FREE!

0

Types range

what determines the range of variable types in java? a byte type's range is -128 to 127. who determines it?

3/3/2018 3:58:31 PM

sal sal

1 Answer

New Answer

+3

It's determined by the designers of the language. A byte is 8 bits in length so can only represent a signed value between -128 to +127. See https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html for more information. There are convenience classes for the primitive data types which contain MAX_VALUE and MIN_VALUE constant field values e.g. Byte.MAX_VALUE Byte.MIN_VALUE The same applies to the Integer, Long, Float and Double wrapper classes etc.