Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    /** Returns true if all elements of c match obj */
    public static boolean all(Collection c, Object obj) {
        for (Iterator iterator = c.iterator(); iterator.hasNext();) {
            Object o = iterator.next();
            if (!o.equals(obj))
                return false;
        }
        return true;
    }
}