About 50 results
Open links in new tab
  1. Why is the range of bytes -128 to 127 in Java? - Stack Overflow

    A better question is why java byte type is not a range of 0..255? In fact many do ask this question, in most languages byte type is unsigned, but in java byte is signed too, and I (and many other) believe …

  2. Purpose of byte type in Java - Stack Overflow

    Apr 24, 2013 · I read this line in the Java tutorial: byte: The byte data type is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The …

  3. java - How to calculate the range of primitive data types ... - Stack ...

    The byte data type can be useful for saving memory in large arrays, where the memory savings actually matters. They can also be used in place of int where their limits help to clarify your code; the fact that …

  4. How does a byte[] in java actually store data - Stack Overflow

    A Java byte is a primitive with a minimum value of -128 and a maximum value of 127 (inclusive). 87 is within the allowed range. The byte data type can be useful for saving memory in large arrays, where …

  5. java byte data type - Stack Overflow

    The byte data type can be useful for saving memory in large arrays, where the memory savings actually matters. They can also be used in place of int where their limits help to clarify your code; the fact that …

  6. What is byte data type in java and Why it is used?

    Oct 22, 2017 · A byte is a fundamental unit of memory, file storage and network data transfer. All the data types you use in Java use one or more bytes. Without knowing what you are confused about, …

  7. Java ResultSet getByte throwing outside of valid range for type java ...

    Apr 4, 2025 · The character string "11" is 0x3131 hex or 12,593 decimal, which is well outside the range for a byte.

  8. java - Getting byte value for numbers between 0 and 255 ... - Stack ...

    Mar 3, 2013 · 2 I need to get the byte / 8 bit representation for numbers between 0 and 255. Is there any comfortable way to do this in Java? Seems like most methods are intended to be work with 4 byte …

  9. about Java byte type value greater than 256 - Stack Overflow

    Mar 31, 2022 · A byte in Java is an octet, 8-bits. This is true of both the byte primitive type and the Byte wrapper class. As a signed value, that means a range of -128 to 127. As an unsigned value, that …

  10. Can we make unsigned byte in Java - Stack Overflow

    The fact that primitives are signed in Java is irrelevant to how they're represented in memory / transit - a byte is merely 8 bits and whether you interpret that as a signed range or not is up to you. There is no …