Java examples for Reflection:Object
down cast object
//package com.java2s; public class Main { @SuppressWarnings("unchecked") public static <T> T downcast(Class<T> klass, Object actual) { if (actual != null && klass.isAssignableFrom(actual.getClass())) return (T) actual; else/* w w w . j a v a 2 s. c o m*/ return null; } }