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) {
        char charArray[] = { 'a', 'b', 'd', 'e' };
        Arrays.sort(charArray);

        char searchValue = 'b';
        System.out.println(Arrays.binarySearch(charArray, searchValue));

        searchValue = 'z';
        System.out.println(Arrays.binarySearch(charArray, searchValue));

    }

}