黑马程序员技术交流社区

标题: 请描述一下程序打印出来的数字序列: [打印本页]

作者: 20091042219    时间: 2015-3-23 21:29
标题: 请描述一下程序打印出来的数字序列:
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) + " ");

    }
}




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2