JAva文字列符号化出力

399 ワード

package day0726_3;

public class StringDemo {

	public static void main(String[] args) {
		//    ASCII     
		byte[] bytes = {97,98,99,100};
		String string = new String(bytes);
		System.out.println(string);
		//     GBK   ,             ,     ,  ?
		byte[] bytes2 = {-97,-98,-99,-100,-101};
		String string2 = new String(bytes2);
		System.out.println(string2);

	}

}