Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static <T> T requireNonNull(T object) {
        return requireNonNull(object, "Null reference");
    }

    public static <T> T requireNonNull(T object, String error) {
        if (object == null)
            throw new NullPointerException(error);

        return object;
    }
}