摘要:
首先,定义一个类A如下classA{staticinta=1;staticintb=2;publicstaticvoidprintA(){System.out.println(a);}publicstaticvoidprintB(){System.out.println(b);}}class A ... 阅读全文
摘要:
String的getBytes()方法是得到一个系统默认的编码格式的字节数组getBytes("utf-8")得到一个UTF-8格式的字节数组把String转换成bytes,各种编码转换成的bytes不同,比如UTF-8每个汉字转成3bytes,而GBK转成2bytes,所以要说明编码方式,否则用... 阅读全文