为什么这里用foreach循环,字符串打印时参数传递不能用score?还有它为什么打印了五遍?求解
这里让人很疑惑
这里让人很疑惑
2020-08-08
无法复现你的情况,甚至还得到错误代码:
HelloWorld.java:15: error: no suitable method found for toString(int) System.out.println(Arrays.toString(score)); ^ method Arrays.toString(long[]) is not applicable (argument mismatch; int cannot be converted to long[]) method Arrays.toString(int[]) is not applicable (argument mismatch; int cannot be converted to int[]) method Arrays.toString(short[]) is not applicable (argument mismatch; int cannot be converted to short[]) method Arrays.toString(char[]) is not applicable (argument mismatch; int cannot be converted to char[]) method Arrays.toString(byte[]) is not applicable (argument mismatch; int cannot be converted to byte[]) method Arrays.toString(boolean[]) is not applicable (argument mismatch; int cannot be converted to boolean[]) method Arrays.toString(float[]) is not applicable (argument mismatch; int cannot be converted to float[]) method Arrays.toString(double[]) is not applicable (argument mismatch; int cannot be converted to double[]) method Arrays.toString(Object[]) is not applicable (argument mismatch; int cannot be converted to Object[]) Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
举报