The binary in Java

Source: Internet
Author: User

  byte bt = (byte) 254;  System.out.println ("BT =" +BT);   /**    * This and the operation is to take the high-level data to remove, accurate is high 1, see the official description of the function,   * found that when the parameter is negative, in fact, Byte can only save the decimal number between -128~127, 128 for 128, and so on, 0 means that   the parameter is added to the 2 32-time Square, also add 3 bytes of bits, and fill 1, the last byte of the case is actually   * For example, the storage is-128, plus 1111 1111 is equivalent to 256-128=128, it becomes an integer 128,   * If the deposit is-1, the corresponding integer should be 255, and 256-1=255   * This is why only go to the   post eight bit */   System.out.println (Integer.tohexstring (BT&0xff));
    • Four basic data types in Java
      • Int:byte (8bit, -128 ~ 127), short (16bit), int (32bit), Long (64bit)
      • FLOAT: Single precision (32bit float), double precision (64bit double)
      • Boolean:true, False
      • Char:unicode characters 16 bit
    • Corresponding class type
      • Integer, Float, Double, Boolean, Character, Byte, short, Long
    • Size End
      • Small-End Method (Little-endian): Low byte emissions at the lower address end of memory that is the starting address of the value, high-bit bytes emitted in the memory of the higher address
      • Big-endian (Big-endian): high-bit byte emissions at the low address end of memory that is the starting position of the value, low-byte emissions at the high address of the memory

The binary in Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.