比如我现在在String类的一个对象中存有0,1序列,"1010101010101010"我要把这个0,1序列表示的
字符保存在一个字符数组中,怎么转化??
    请牛人指点指点..

解决方案 »

  1.   

    toCharArray
    public char[] toCharArray()Converts this string to a new character array. Returns:
    a newly allocated character array whose length is the length of this string and whose contents are initialized to contain the character sequence represented by this string.
      

  2.   

    不是这个问题,是把01序列表示的字符转化出来,你用toCharArray()的方法只是把STRING里面的内容转化出来了,但是这个0,1序列转化出来的结果没有,这样出来还是0,1序列.
      

  3.   

    楼主的意思好像是说一个char用8 位存,把这八位二进制码那出来转回一个字符是吧?
      

  4.   

    char c=(char)Integer.parseInt(str,2);