Packagecom.suypower.chengyu.test; Public classBytetest {/*** Byte 8 bits-128-+ 127 * 1 bit = 12 binary data * 1 byte = 8 bit * 1 letter = 1 byte = 8 bit (bit) * 1 kanji = 2 byte = + bit*/ Public Static voidMain (string[] args) {//TODO auto-generated Method Stub byteB1 = 127; byteb2 =-128; byteB3 = ' a '; byteB4 = ' A ';//One letter = 1 byte = 8 bit//byte B5 = ' AA '; This is wrong.//byte B6 = ' Medium '; it's a mistake. 2 bytes 16bit ShortS1 = ' ah ';//a kanji 2 bytes 16bit Short is a bit of//Short s2 = ' kanji '; //2 Kanji 4 bytes The three-bit int is the three-bit//int i1 = ' Kanji '; But int is a numeric type, char is a bit = 2 byte = a kanji CharC1 = ' Khan '; //byte conversion stringString string = "Chinese"; byteBy[] =string.getbytes (); String Str=NewString (by); System.out.println ("Str=" +str); } } ==================================================================================[Java-Original] bit,byte, bits, bytes, kanji, character bit,byte, Bits, Bytes, Chinese characters relations1 bit = 1Binary Data1byte= 8bit1 letter = 1byte= 8bit1 Kanji = 2byte= 16bit1. Bit: bit a binary data 0 or 1, is 1bit;2.byte: The basic unit of measure for byte storage, such as: a VARCHAR defined in MySQL (45) that means 45 bytes;1byte= 8bit3. An English character occupies one byte;1 letter = 1byte= 8bit4. A kanji account of 2 bytes;1 Kanji = 2byte= 16bit5. Punctuation A>. In the Chinese character input state, the default is full-width input mode; B>. In the English input state, the default is half-width input mode; C>. In full-width input mode, punctuation is 2 bytes; D>. In the half-angle input mode, the punctuation mark occupies 1 bytes; therefore: Characters in the Chinese character input state, accounting for 2 bytes (but do not exclude, they changed the default settings); The characters in the English input state, accounting for 1 bytes (but do not exclude, the default settings have changed);
Java bit, byte, bit, byte, kanji, character