请大家帮帮我 ,
String data[]=new String[26]  是和全局变量;
在一个循环中使用后,
为了下一次循环.怎么将上一次的data[]数据清空啊,

解决方案 »

  1.   

    清空?
    java.util.Arrays.fill(data,null);
    java.util.Arrays.fill(data,"");
      

  2.   

    那对StringBuffer strbuff=new StringBuffer();
     使用了有,怎样将其中的数据清除?以免影响下一次的使用,
    快帮帮我啊,急啊!
      

  3.   

    数组问题,用 for() 解决了
    但我现在遇到了StringBuffer strbuff=new StringBuffer();问题了,
    我第一次使用strbuff了,但我第二次使时,前一次的数据还在啊,
    怎样才能将前一次的数据清空呢?快帮帮忙啊?
      

  4.   

    看一下api啊,delete,replace,都可以
    delete
    public StringBuffer delete(int start,
                               int end)Removes the characters in a substring of this sequence. The substring begins at the specified start and extends to the character at index end - 1 or to the end of the sequence if no such character exists. If start is equal to end, no changes are made. replace
    public StringBuffer replace(int start,
                                int end,
                                String str)Replaces the characters in a substring of this sequence with characters in the specified String. The substring begins at the specified start and extends to the character at index end - 1 or to the end of the sequence if no such character exists. First the characters in the substring are removed and then the specified String is inserted at start. (This sequence will be lengthened to accommodate the specified String if necessary.)
      

  5.   

    strbuff.delete(0, strbuff.length());我以前是这样处理的,笨了点,但效果能达到