Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;

public class Main {
    public static int indexOf(ArrayList<String> list, String value) {
        for (int i = 0; i < list.size(); i++) {
            String name = list.get(i);
            if (value.equals(name)) {
                return i;
            }
        }
        return -1;
    }
}