Here you can find the source of castObject(Object ob)
Parameter | Description |
---|---|
T | The type of object to return. |
ob | The object to cast. |
@SuppressWarnings("unchecked") public static <T> T castObject(Object ob)
//package com.java2s; public class Main { /**//from www . j a v a 2s . c o m * Reads an object from an input and converts it to the appropriate type. * * @param <T> The type of object to return. * @param ob The object to cast. * * @return The casted object. */ @SuppressWarnings("unchecked") public static <T> T castObject(Object ob) { return (T) ob; } }