本帖最后由 fengche 于 2013-10-19 18:39 编辑
- public class StringCheese {
- public static void main(String[] args) {
- byte bytes[] = new byte[256];
- for (int i = 0; i < 256; i++)
- bytes[i] = (byte)i;
- String str = new String(bytes);
- for (int i = 0, n = str.length(); i < n; i++)
- System.out.println((int)str.charAt(i) + " ");
- }
- }
复制代码 该程序并没有按顺序打印出0到255的整数这是为什么? |