Home > Back-end >  T cast object has warned
T cast object has warned

Time:11-06

Use the generic type T, argument is the object, the method to instantiate objects in
 
ArrayList Objects;
Objects. The add ((T) object. GetClass () getDeclaredConstructor (). The newInstance ());

The purpose is to want to get an instance from the object, and then added to the ArrayList, this warning is there any way?
  • Related