Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class Main {
    public static BlockingQueue<Runnable> makeQueue(Integer capacity) {
        if ((capacity == null) || (capacity <= 0) || (capacity == Integer.MAX_VALUE)) {
            return new LinkedBlockingQueue<Runnable>();
        } else {
            return new ArrayBlockingQueue<Runnable>(capacity);
        }
    }
}