The code works when I used java.util.Arrays.sort(numbers); Am I doing something wrong? It seems strange to me.
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)); } }
(The error is displayed in the terminal)
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
source share