Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {
    public static void main(String args[]) {

        List<String> arlst = new ArrayList<String>();

        arlst.add("CSS");
        arlst.add("HTML");
        arlst.add("PHP");

        // search the list for key 
        int index = Collections.binarySearch(arlst, "HTML");

        System.out.println(index);
    }
}