Why does the toString method in java not seem to work for an array

后端 未结 9 1575
灰色年华
灰色年华 2020-11-22 12:25

I want to convert a character array to a string object using the toString() method in java. Here is a snippet of the test code I used:

import java.util.Array         


        
9条回答
  •  醉话见心
    2020-11-22 13:11

    this way I found worked:

    public String convertToString(char[] array, int length)
    {
    String char_string;
    String return_string="";
    int i;
    
       for(i=0;i

提交回复
热议问题