Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        int items[] = { 5, 4, 6, 1, 8, 9, 6, 7, 3, 2 };

        Arrays.sort(items);

        int index = Arrays.binarySearch(items, 1);

        System.out.println("Search item found at: " + index);
    }
}