Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

public class Main {
    private static <T> boolean equlWithoutComparator(List<T> l1, List<T> l2) {
        final int n1 = l1.size();
        for (int i = 0; i < n1; i++) {
            T e1 = l1.get(i);
            T e2 = l2.get(i);
            if (e1 == null) {
                if (e2 != null) {
                    return false;
                }
            } else if (!e1.equals(e2)) {
                return false;
            }
        }
        return true;
    }
}