Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * Copyright (C) 2009 Emweb bvba, Leuven, Belgium.
 *
 * See the LICENSE file for terms of use.
 */

import java.util.List;

public class Main {
    public static <V> boolean add(List<V> list, V v) {
        if (list.indexOf(v) == -1) {
            list.add(v);
            return true;
        } else
            return false;
    }
}