Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Iterator;

public class Main {
    public static <T> Iterable<T> makeEmptyIterable() {
        return new Iterable<T>() {
            public Iterator<T> iterator() {
                return new Iterator<T>() {
                    public boolean hasNext() {
                        return false;
                    }

                    public T next() {
                        return null;
                    }

                    public void remove() {
                        throw new UnsupportedOperationException("remove not allowed");
                    }
                };
            }
        };
    }
}