About 632,000 results
Open links in new tab
  1. 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 byte data type can be useful for saving memory in large arrays, where the memory savings actually matters.

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

    Oct 22, 2017 · 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 byte data type can be useful for saving memory in large arrays, where the memory savings actually matters.

  3. java byte data type - Stack Overflow

    In Sun' tutorial it says about a byte: 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 byte data type can be useful for saving memory in large arrays, where the memory savings actually matters.

  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 the memory savings actually matters. A byte[] is an Object which stores a number of these primitives.

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

    no of values data type can have=2^n(2 power n), where n represents no of bits. so the value of byte data type=2^8(i.e 1 byte=8 bits),here n=8 byte value=256. And it should be shared equal on both sides of zero ( half values at negative and half value at positive ). Hence the range for byte is from -128 to 127.

  6. Why is the range of bytes -128 to 127 in Java? - Stack Overflow

    Without getting into two's complement: 2^8 (since a byte is 8 digits and can have 1 of 2 values) = 256, so the most individual values a byte can represent is 256. so, representing the numbers -128 to -1 is half our range. I believe the question here is …

  7. Practical use of byte data type in Java - Stack Overflow

    byte is a 8-bit signed primitive-type in java. It is usefull in the situations where we are dealing with the data in the form of bytes such as "Reading/writing the byte data from/to files". You can find the best practical example at here.

  8. How do you specify a byte literal in Java? - Stack Overflow

    Mar 4, 2011 · You can use a byte literal in Java... sort of. byte f = 0; f = 0xa; 0xa (int literal) gets automatically cast to byte.

  9. How do I initialize a byte array in Java? - Stack Overflow

    Jun 26, 2012 · Hex.decodeHex(char[] data) which throws a DecoderException if there are non-hex characters in the array, or if there are an odd number of characters. Hex.encodeHex(byte[] data) is the counterpart to the decode method above, and spits out the char[]. Hex.encodeHexString(byte[] data) which converts back from a byte array to a String.

  10. java - What do we mean by Byte array? - Stack Overflow

    Oct 26, 2010 · A byte is 8 bits (binary data). A byte array is an array of bytes (tautology FTW!). You could use a byte array to store a collection of binary data, for example, the contents of a file. The downside to this is that the entire file contents must be loaded into memory.

Refresh