代码在我使用时有效java.util.Arrays.sort(numbers);
我做错了吗?这对我来说似乎很奇怪。
import java.util.Arrays.*;
class Test {
public static void main(String[] args) {
double[] numbers = {6.0, 4.4, 1.9, 2.9, 3.4, 3.5};
char[] chars = {'a', 'A', '4', 'F', 'D', 'P'};
sort(numbers);
System.out.println(binarySearch(numbers, 3));
}
}
(终端显示错误)
Test.java:8: error: cannot find symbol
sort(numbers);
^
symbol: method sort(double[])
location: class Test
Test.java:10: error: cannot find symbol
System.out.println(binarySearch(numbers, 3));
^
symbol: method binarySearch(double[],int)
location: class Test
2 errors