package javaLearning;
import java.util.Arrays;
import java.util.Collections;
public class myarray {
public static void name() {
String hello;
hello = "hello, world";
int hello_len = hello.length();
char[] hello_array = new char[hello_len];
hello.getChars(0, hello_len, hello_array, 0);
Arrays.sort(hello_array, Collections.reverseOrder());
}
"myarray"类在测试类的主方法中定义。为什么当我尝试反转数组时会出现编译错误?
haa
是什么?请贴上你的真实代码。 - Oliver Charlesworth