Java - Cast

1 - About

Cast is a coercion function.

The cast method of Class is the dynamic analog of Java's cast operator.

It casts an object to the class or interface represented by the Class object.

It simply checks that its argument is an instance of the type represented by the Class object.

If so, it returns the argument; otherwise it throws a ClassCastException.

If your object implement a type, it can be cast to it

3 - Code

public class Class<T> {
    T cast(Object obj);

4 - Documentation / Reference

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap