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 getView(Object object, Class<T> t) {

        try {
            return (T) object;
        } catch (ClassCastException e) {

            throw new IllegalStateException(object.getClass().getSimpleName() + t.getSimpleName()
                    + " does not implement contract interface", e);
        }
    }
}