The java. lang. Class. cast() method casts an object to the class or interface represented by this Class object.
How do you cast an object to a class?
The java. lang. Class. cast() method casts an object to the class or interface represented by this Class object.