Java Object Type Case cast(Object o)

Here you can find the source of cast(Object o)

Description

Perform an unchecked cast.

License

Open Source License

Parameter

Parameter Description
T the implicit type to cast to.
o the instance to cast.

Return

the cast instance.

Declaration

public static <T> T cast(Object o) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU Lesser General Public License as published by

public class Main {
    /**//  w ww  . j  a v  a  2s .c  o  m
     * Perform an unchecked cast.
     * 
     * @param <T>
     *            the implicit type to cast to.
     * @param o
     *            the instance to cast.
     * @return the cast instance.
     */
    public static <T> T cast(Object o) {
        return (T) o;
    }
}

Related

  1. cast(final Object original)
  2. cast(int value)
  3. cast(int value)
  4. cast(long value)
  5. cast(Object inValue)
  6. cast(Object o, Class clazz)
  7. cast(Object o, Class klass)
  8. cast(Object o, String clazz)
  9. cast(Object obj, Class clazz)