- import java.util.*;
- class Test
- {
- public static void main(String[] args)
- {
- char[] s={'a','d','f','c','w'};
- System.out.println(s);
- char[] a={'u'};
-
-
- System.out.println(a.toString(s));//¥¥¥¥¥¥¥¥¥¥¥
- System.out.println(Arrays.toString(s));
-
- }
- }
复制代码 为什么数组中toString方法,用a调用就不行呢?错误提示:The method toString() in the type Object is not applicable for the arguments (char[]) 。问题在¥¥¥行。
|